
Goodbye Docker on CentOS, Hello Ubuntu - rusher81572
https://www.linux-toys.com/?p=374
======
diebir
I would rather say "goodbye docker", period. Having used it a bit, I have
concluded that it is just not a very good or mature tool. Once you scratch
under the surface, things cease to be easy or stop working at all. It makes
you wonder how it's been this long and nobody stumbled upon an issue that you
uncover 30 minutes into tool's use.

Docker does have it's uses, but in the majority of cases you are better off
using native OS package and dependency management (RPM/YUM in the case on
Redhat-based distros). One very obvious thing is that package managers usually
track versions and dependencies and allow for install actions to happen based
on the versions delta. With Docker you just replace the whole environment,
which is fine, unless some of the data context is outside of Docker.

I think the majority of Docker uses are of a class "I can't figure out how to
manage dependencies for a given OS, so I am going to skirt the issue by using
Docker".

~~~
volent
"It makes you wonder how it's been this long and nobody stumbled upon an issue
that you uncover 30 minutes into tool's use."

Either you're doing something wrong or everybody's extremely lucky. If you've
used Docker for 30 minutes I would bet on the former :)

~~~
zimbatm
Or everyone got used to it and don't consider it being an issue.

I believe that the filesystem layering feature in Docker is an anti-feature.
It depends on unstable kernel features to work properly and doesn't really
address the caching issues properly. Dependencies are usually in a tree, not
linear like presented in a Dockerfile.

------
infodroid
By default, Docker will use the AUFS storage backend if available, and then
fall back to devicemapper on loopback.

RHEL, CentOS, and Fedora do not ship the AUFS kernel module because it is not
part of the mainline Linux kernel and is unlikely to be included in future,
and these distros have an "upstream first, no out-of-tree bits" policy.
Instead, they recommend using devicemapper on LVM [1][2].

The same advice is provided in the official Docker documentation [3]:

> Docker hosts running the devicemapper storage driver default to a
> configuration mode known as loop-lvm... The mode is designed to work out-of-
> the-box with no additional configuration. However, production deployments
> should not run under loop-lvm mode... The preferred configuration for
> production deployments is direct lvm.

You might consider using CentOS Atomic Host, which comes preconfigured with
LVM thin pools.

OverlayFS is also an alternative, but it can be problematic. It only
implements a subset of the POSIX standard [4], which can cause some programs
to fail.

[1] [http://www.projectatomic.io/blog/2015/06/notes-on-fedora-
cen...](http://www.projectatomic.io/blog/2015/06/notes-on-fedora-centos-and-
docker-storage-drivers/) [2] [https://access.redhat.com/documentation/en/red-
hat-enterpris...](https://access.redhat.com/documentation/en/red-hat-
enterprise-linux-atomic-host/version-7/getting-started-with-
containers/#managing_storage_with_docker_formatted_containers) [3]
[https://docs.docker.com/engine/userguide/storagedriver/devic...](https://docs.docker.com/engine/userguide/storagedriver/device-
mapper-driver/) [4]
[https://docs.docker.com/engine/userguide/storagedriver/overl...](https://docs.docker.com/engine/userguide/storagedriver/overlayfs-
driver/)

~~~
dvusboy
The author of the original blog is confusing the issue of base-image of a
Docker image and the host OS on which the Docker daemon is running. They are
completely orthogonal issues. Yes, there've been plenty of complaints about DM
performance and space reclamation issues. By all means, switch the _host_ OS
from CentOS/Fedora to Ubuntu if it alleviates the problems. The base-image is
a completely different matter. There is no reason to switch from CentOS/Fedora
to Ubuntu just because you changed the host OS. This is point of the
filesystem isolation Docker provides.

~~~
rusher81572
The base-image is a completely different matter. There is no reason to switch
from CentOS/Fedora to Ubuntu just because you changed the host OS

>> Yes, there is. There is a known issue using AUFS(Which Ubuntu uses for
Docker) with CentOS/Fedora images:

[https://github.com/docker/docker/issues/6980](https://github.com/docker/docker/issues/6980)

To make it easier, I just changed the base image from CentOS/Fedora to Ubuntu
so I do not have to worry about it.

------
Patrick_Devine
You can find some notes on tuning devicemapper here:

[https://jpetazzo.github.io/assets/2015-03-03-not-so-deep-
div...](https://jpetazzo.github.io/assets/2015-03-03-not-so-deep-dive-into-
docker-storage-drivers.html#44)

If you've got a new enough kernel though (i.e. 3.18+), you're best off using
Overlay for your storage driver. It's fast and doesn't require a lot of
tuning.

~~~
elricL
Last I checked, OverlayFS did not play well with tools like Yum/Pip. Has this
been fixed?

------
codinghorror
I strongly DO __NOT __recommend using devicemapper as storage in Docker. Every
time we have tried, and every customer who has tried, has failed medium to
long term, in bad ways. It became so painful that we literally blacklist
devicemapper as a supported filesystem in the Discourse installer.

We waited a year for this to "stabilize" but it never did.

------
cmurf
I haven't used AUFS or overlay(fs), only devicemapper (thin provisioning) and
Btrfs. Btrfs is faster than devicemapper, but even creating and removing
containers seems slower than it ought to be considering how little delta there
is. The create/remove time with 'btrfs sub crea/del' is much faster than
docker create or remove (container), so I'm not really sure where the delays
are.

~~~
rusher81572
Good comment. Did you try on CentOS or Ubuntu?

~~~
cmurf
Fedora Cloud Atomic 23 on an Intel NUC.

------
stefanha
Never had performance issues with the Docker device-mapper graph driver on
Fedora 23. No tweaking was necessary. I imagine CentOS is similar although it
may not use the latest and greatest features.

There is not enough information in this blog post to say exactly what the
problem is, but switching distros may be overkill here.

------
lox
For some background: [https://developerblog.redhat.com/2014/09/30/overview-
storage...](https://developerblog.redhat.com/2014/09/30/overview-storage-
scalability-docker/)

Overlay(fs) is likely going to be the way forward.

------
hhw
From the op: "I enjoyed its minimal install to create a light environment,
intuitive installation process, and it’s package manager."

CentOS is neither minimal nor light. Ubuntu also isn't either of these things.
Both of these distributions are more targeted towards convenience and ease of
use, which means a lot of features/services that are generally unnecessary are
enabled by default. The main reasons to use CentOS is compatibility with
proprietary software made for RHEL, Ubuntu for people already familiar with
its desktop version, or if needing to buy enterprise support for either.

If the op is primarily looking for minimal and light, he should look at pretty
much any other major popular Linux distribution like Debian proper, Slackware,
or Gentoo before CentOS or Ubuntu.

~~~
mbreese
The minimal CentOS install is pretty lightweight. It's not a tiny distro by
any means, but for keeping w/in the RHEL/CentOS realm, it's really pretty
good. It's the only version that I install on servers, just to keep the excess
cruft out (no X, no Gnome, no extra services, etc...).

~~~
delonia
Ubuntu has "Ubuntu server" which is Ubuntu without X, GNOME and other desktop
services.

In addition, there is Ubuntu Minimal
([https://help.ubuntu.com/community/Installation/MinimalCD](https://help.ubuntu.com/community/Installation/MinimalCD))
which is the most minimal you can get in Ubuntu.

------
akeck
I've had different trouble with Docker on CentOS 7. Last November, I created a
POC Kubernetes cluster on top of the shipping CentOS 7 Docker infrastructure
(1.8 at the time), and then beat the hell out of it. After a week or so, I
lost a node to XFS file system corruption in the Docker image tree. The only
solution I could find that worked was uninstalling Docker, wiping the Docker
image tree in /var, and then reinstalling Docker. Kubernetes would then resume
distributing containers to the node. Every node died in this manner at least
once during the POC. With Kubernetes managing the containers, it wasn't a
disaster - just really annoying.

------
vonklaus
Any chance you can link to a "getting started" docker on Ubuntu writeup?

~~~
Jedd
This one was posted on HN a few days ago. Not specifically Ubuntu-related, but
includes Ubuntu. Also aimed at EC2 rather than DO, however one imagines the
ideas behind a fully portable ersatz VM approach are, well, fully portable.

[https://news.ycombinator.com/item?id=10890233](https://news.ycombinator.com/item?id=10890233)

