Support official Docker packages on Red Hat/CentOS

Docker is officially supported in RHEL/CentOS 7 in the extras repository: How is the docker container runtime supported in RHEL 7? - Red Hat Customer Portal

They provide two different packages, docker (1.12.6) and docker-latest (1.13.1): Introducing docker-latest for RHEL 7 and RHEL Atomic Host - Red Hat Customer Portal

As with everything included in the base distro, they are maintained by Red Hat and fixes are backported as necessary. Red Hat’s Docker packages are stable and used in production for their OpenShift Enterprise product.

However, the Discourse installer refuses to use them, since it does not know that they are Red Hat LTS version, which makes sense if you’re using the official Docker repository, but not with Red Hat’s packages. Installing the Docker 3rd party repository is unsupported by Red Hat, introduces an additional dependency and is and potentially less stable than using the Red Hat packages.

I can confirm that the Discourse cloud setup - with the version check commented out - works perfectly fine with CentOS 7.4 and docker-latest (1.13.1).

The Discourse installer should detect RHEL and do some basic RHEL-specific checks:

  • we might want to check for ftype=0 on XFS, but it probably works fine even with ftype=0 set (many production OpenShift setups use ftype=0 without experiencing issues, as far as I know, it’s mostly about performance)
  • either correct SELinux context set for Docker volumes or Docker configured without --selinux-enabled (by default, Red Hat’s Docker version uses SELinux sVirt as an additional layer of security against container escapes - it can be turned off without disabling SELinux for the whole system)

We’ve just hit this issue too. The launcher fails on CentOS 7 for many reasons, including complaining that the storage system devicemapper is unsupported. The image builder also craps out because it does not support selinux.

After reviewing how this launcher works I think the best course of action is to throw it under a bus. It is a fractal of poor decisions. It makes a joke of running containers anywhere the Docker daemon runs. It should be made clear that Discourse is supported only on “Ubuntu”. The Docker support is incidental. Don’t expect to run this on ECS, CoreOS, Kubernetes etc.

That’s inaccurate though; Red Hat is about the only distro which barely works with Docker. We had to blacklist devicemapper because so many Docker installs failed with it.

Your time would be better spent asking why Red Hat has such poor Docker support, on either side (Red Hat, or Docker).

Docker support on RHEL/CentOS was in a pretty bad shape a few years ago, but this is no longer the case, especially with the overlay2 storage driver on 7.3+. I run multiple production clusters on it with no issues.

However, I agree with you that there are many ways to get it wrong (i.e. using devicemapper, using third party Docker packages, …). The devicemapper driver in particular is known to cause issues - it runs on a loop device by default, which is unsuitable for production. It needs to run on a LVM thin pool and even then I’ve seen weird build failures with it.

This configuration is known to work:

  • at least RHEL/CentOS 7.4
  • overlay2 storage driver on xfs with d_type=1 or ext4
  • running Red Hat’s docker or docker-latest packages

If you do a PR for launcher that tests for d_type=1 xfs or ext4 and overlay2 I am happy to let it through.

1 Like