Showing posts with label rhel. Show all posts
Showing posts with label rhel. Show all posts

Friday, August 17, 2018

Red Hat Container Development Kit 3.5 - Installation Issue with Libvirt (KVM) Group Membership

If you follow the installation instructions for Red Hat's Container Development Kit 3.5, on RHEL 7.5, most everything works well, until you get to the point of starting the virtualized minishift host:



You get a failure when trying to connect to Docker on the VM.  The problem is that, if you strictly follow the instructions, your user is not a member of the 'libvirt' group.  This is easy to rectify, though.  All you need to do is:

1) Remove the existing minishift VM:



2) Add yourself to the requisite group:



3) And relaunch minishift:



Hopefully I can get the docs updated, so this isn't necessary, in the near future.

Friday, June 29, 2018

Adding Packages to RHEL Containers on Amazon EC2 with Cloud Access

I just ran into an interesting use case, where I'd needed to be able to add packages to my RHEL containers, when they are hosted on Amazon's EC2.  Anyone else who has tried this may have run into the same problem, that RHEL subscription information isn't passed to containers, by default, when run on cloud access instances.

For example:

# podman run --rm -it registry.access.redhat.com/rhel7
[root@7a52d3bac972 /]# yum install httpd
Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager
This system is not receiving updates. You can use subscription-manager on the host to register and assign subscriptions.
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>

In order to work around this, you can use bind mounts, as described in the podman man page, in the section on --volume.  There are a number of files and directories that you will need to mount.  In the below example, you can see a successful run:

# podman run \-v /etc/pki/rhui:/etc/pki/rhui \-v /etc/yum/pluginconf.d:/etc/yum/pluginconf.d \ -v /etc/yum/pluginconf.d/rhnplugin.conf:/etc/yum/pluginconf.d/rhnplugin.conf \-v /etc/yum.repos.d/redhat-rhui.repo:/etc/yum.repos.d/redhat-rhui.repo \-v /etc/yum.repos.d/redhat-rhui-client-config.repo:/etc/yum.repos.d/redhat-rhui-client-config.repo \-v /etc/yum.repos.d/rhui-load-balancers.conf:/etc/yum.repos.d/rhui-load-balancers.conf \-v /usr/lib/yum-plugins:/usr/lib/yum-plugins \-v /usr/share/rhn:/usr/share/rhn \-v /usr/share/yum-plugins:/usr/share/yum-plugins \--rm -it registry.access.redhat.com/rhel7

For an offline run of the container, you will need to copy in those same files.  However, if you only want to install files to a container running on persistent storage, temporary mapping of the RHUI-required files and directories is sufficient.