Does a RHEL7 docker container need subscription? - docker

I have a rhel7 host with docker in it.
I have build a image with also rhel7 as base image.
But when I run the container & do yum update or try to install in package with yum, it gives me below error.
"This system is not registered to Red Hat Subscription.you can use subscription manager to register"
I have already subscribed the host RHEL Machine. Do I need to subscribe each and every container with rhel image?
Or
Do I need to subscribe in the dockerfile itself while building the image?
Thanks

On the Docker hub, you can find some Red Hat docker images , like
https://hub.docker.com/r/richxsl/rhel6.5/
or
https://hub.docker.com/r/lionelman45/rhel7/
but in order to update them, you will need a valid subscription
You will find Red Hat docker images on the Red Hat site, at
https://access.redhat.com/containers
this article summarizes what you need in order to build a Red hat docker image
http://cloudgeekz.com/625/howto-create-a-docker-image-for-rhel.html
it begins with
Pre-requisites
Access to RHEL package repository.

With RHEL 8 Red Hat now offers a universal base image for docker containers which does not require a subscription.

The RHEL 7 documentation covers this. Please use your subscription to read section 1.4.
Paraphrasing what the documentation says:
You must use a subscribed RHEL 7 host to build containers
Containers based on RHEL 7 will use the host's subscription automatically and be able to access the RHEL 7 yum repositories
If you are trying to build RHEL 7 based containers on a properly subscribed RHEL 7 host and it doesn't work, you might be running into a bug. I would contact support to try and sort this out.

I used podman to pull RHEL 7 Universal Base Image, like this:
podman pull registry.access.redhat.com/ubi7/ubi
After that, although I still saw the warning message:
This system is not registered with an entitlement server. You can use subscription-manager to register.
but there was no issue to use yum for package installation or update.
You can also use RHEL8 ubi in the same approach without any issue.

I found this article that clarifies the RHEL UBI images which do not need a subscription.
https://developers.redhat.com/blog/2020/03/24/red-hat-universal-base-images-for-docker-users/
docker search registry.access.redhat.com/ubi
docker run -it --name test registry.access.redhat.com/ubi8/ubi:8.1 bash
I tried yum to install a netcat command which worked seamlessly

The RHEL UBI image contains 3 default repos (see yum repolist). Subscription is required for the CodeReady repo (ubi-8-codeready-builder).
If you decide to NOT subscribe then you can hide those warnings with:
yum --disableplugin=subscription-manager install <package>
Source:
https://developers.redhat.com/blog/2020/03/24/red-hat-universal-base-images-for-docker-users/

Related

Can I Install Docker Over cPanel?

Can I install Docker over a server with pre-installed cPanel and CentOS 7? Since I am not aware of Docker, I am not completely sure whether it will mess with cPanel or not. I already have a server with CentOS 7 and cPanel configured. I want to know if I can install Docker over this configuration I mentioned without messing up?
Yes you can install docker over cPanel/WHM just like installing it on any other CentOS server/virtual machine.
Just follow these simple steps (as root):
1) yum install -y yum-utils device-mapper-persistent-data lvm2 (these should be already installed...)
2) yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3) yum install docker-ce
4) enable docker at boot (systemctl enable docker)
5) start docker service (systemctl start docker)
The guide above is for CentOS 7.x. Don't expect to find any references or options related to Docker in the WHM interface. You will be able to control docker via command line from a SSH shell.
I have some docker containers already running on my cPanel/WHM server and I have no issues with them. I basically use them for caching, proxying and other similar stuff.
And as long as you follow these instructions, you won't mess-up any of your cPanel/WHM services/settings or current cPanel accounts/settings/sites/emails etc.
Not sure why you haven't tried this already!
I've been doing research and working on getting Docker working on cPanel. It's not just getting it to work on a CentOS 7 box but rather making it palatable for the cPanel crowd in the form of a plugin. So far I can confirm that it's absolutely doable. Here's what I've accomplished and how:
Integrate Docker Compose with cPanel (which is somewhat a step
further from WHM)
Leverage the user-namespace kernel feature in Linux so Docker
services can't escalate their privileges (see userns remap)
Leverage Docker Compose so users can build complex services and
start ready apps from the store with a click
Make sure services starting via Docker run on a non-public IP on the
server. Everything gets routed via ProxyPass
cPanel has been gracious to provide a Slack channel for people to discuss this upcoming plugin. I'd be more than happy to invite you if you'd like to be kept updated or to contribute. Let me know!
FYI, there's more info here on https://www.unixy.net/docker if you're interested. Please note that this plugin is in private beta but more than happy to let people use it!
Yes you could, in fact someone else has done it already: https://github.com/mirhosting/cPanel-docker

Cloudera and Docker

I want to run Cloudera using a Docker image (specifically, the cloudera/quickstart image).
However, on Docker Hub I can only find beta versions:
https://hub.docker.com/r/cloudera/quickstart/tags/
What's the correct way of getting a more up-to-date image?
Should I just download a beta image and then install parcels? Would I do that using Docker Compose? If so, can I find instructions for that online?
Or is there a completely different way to solve this?
To run Cloudera Quickstart within Docker, follow the instructions on that page:
https://www.cloudera.com/documentation/enterprise/latest/topics/quickstart_docker_container.html
Forget about your concerns regarding the "beta" tag. These tags are there, because the Docker image of Cloudera Quickstart is in beta mode. However, the CDH version in there is not.
You will find this out on your own, once you run the container and check the CDH version inside.

Docker hanging requiring reboot

We are running docker 1.7.1, build 786b29d on RHEL 6.7. Recently we have had multiple times when the docker daemon locked up and we had to reboot the machine to get it back.
A typical scenario is that a container that has been running fine for weeks suddenly starts throwing errors. Sometime we can restart the container and all is well. But other times all docker commands will hang, and restarting the daemon fails, and I see this in a ps:
4 Z root 4895 1 0 80 0 - 0 exit Aug23 ? 00:01:24 [docker]
Looking in the system log I've seen this:
device-mapper: ioctl: unable to remove open device docker-253:6-1048578-317bb6ad40cded3fbfd752d95551861c2e4ef08dffc1186853fea0e85da6b12b
INFO: task docker:16676 blocked for more than 120 seconds.
Not tainted 2.6.32-573.12.1.el6.x86_64 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
docker D 000000000000000b 0 16676 1 0x00000080
ffff88035ef13ea8 0000000000000082 ffff88035ef13e70 ffff88035ef13e6c
ffff88035ef13e28 ffff88062fc29a00 0000376c85170937 ffff8800283759c0
0000000000000400 00000001039d40c7 ffff8803000445f8 ffff88035ef13fd8
Call Trace:
[] _mutexlock_slowpath+0x96/0x210
[] ? wake_up_process+0x15/0x20
[] mutex_lock+0x2b/0x50
[] sync_filesystems+0x26/0x150
[] sys_sync+0x17/0x40
[] system_call_fastpath+0x16/0x1b
The latest docker version is 1.12.1 and we are on 1.7.1. Can or should I install a new version? 1.7.1 is the version yum installs. If I did want a new version how would I install that (sorry if that is a dumb question, I am not a sys admin).
Googling, I found on this on a Red Hat site "Red Hat does not recommend running any version of Docker on any RHEL 6 releases." We have been running docker on RHEL 6 for a few years, so this confuses me. Upgrading to RHEL 7 is not really an option for us right now.
Can anyone shed any light on these issue? We need docker to work reliably without having to reboot often.
Docker 1.7.1 is really old by today's standards. There have been hundreds of bugs fixed, enhancements to driver stacks, security patches, and valuable features added in the versions since. It looks like you're having a issue with your storage stack, and there is a good chance this is fixed in a newer version.
Docker has stated that default versions in package management systems like yum and apt can be way out of date, and that you should use their repo. The best way to do this is add their Yum repo information to your system so you can install it like other packages. The instructions are here: Installation on Red Hat Enterprise Linux.
Note: This will allow you to install Docker, and the service will be called docker, but the package is docker-engine. This has confused some people in the past.
yum install docker-engine
Docker has also provided a script that does this to make things easier (run as admin/root):
curl -fsSL https://get.docker.com/ | sh
Don't use a RHEL6 based system.
RHEL6 uses a 2.6 kernel with backported fixes to keep Docker working. Docker would normally require a 3.10+ kernel. Docker dropped support for RHEL6 from v1.8 on so it's unlikely there will be any more packages for it.
If you must use RHEL6, don't use the default loopback devicemapper for storage. Setup an LVM thin pool for Docker to use.

Options to use latest docker on centos 6?

I would like to try new features in latest version of docker (1.10 for now), like "docker networks" and "docker volume".
I have CentOs 6 and I CAN NOT upgrade OS due to some restrictions (understand I can use latest docker in centos 7). I do have root permission.
I am wondering what's the options I have to try latest docker?
You can try to use a static binary to run docker, but this is all at your own risk; CentOS 6 runs on kernel 2.6, which is 13 years old now. That kernel misses various things needed to run Docker (e.g. Overlay networking is not supported), and is known for having some issues.
Note that running docker-in-docker may get you around "installing" docker 1.10, but will still run on the same kernel, so you'll end up with the same issues
You could install docker-machine and run docker-machine upgrade default
As described here
EDIT - This does not apply to you
But this question is possibly a duplicate of yours

How to install docker-engine using docker binary without internet connection

I have downloaded docker binary version 1.8.2 and copied that to my backup server (centos server) which doesn't have internet connectivity. I have marked this as executable and started the docker daemon as mentioned in [https://docs.docker.com/engine/installation/binaries/][1]. But it doesn't seem to get installed as a docker service. For all the commands, I have to execute as sudo ./docker-1.8.2 {command}. Is there a way to install docker-engine as a service? Currently sudo docker version shows command not found. I'm a newbie to docker setup. Please advise.
Why not download the rpm package (there are also centos 6 packages), copy to USB stick and then to your server and simply install it with rpm command and that's it. That way you'd get the same installation as if you were to run yum.
Of course you may have some dependencies missing, but you could download all of these as well.
Firstly, if you're downloading bare binaries on an enterprise linux, you're probably doing things in a very bad way. Immediately, you're breaking updates and consistency, and leaving your system in a risky, messy state.
Try using yumdownloader --resolve to get the docker installable and anything it needs.
A better option may be to mirror the installation artifacts, and grab it from the local mirror, but that's beyond the scope if you don't do this already.

Resources