Docker Storage Config on CentOS 7.1

Hello

I’m looking for some input on Docker storage configuration for production CentOS 7.1 systems. I understand that the default Docker storage config that ships with CentOS 7 is not recommended for production use and I’ve been researching best practices. The recommended solution looks to be running Docker on top of an LVM thin pool. After adding a new disk, I was able to make this work in my development environment (see commands below).

Any opinions about this? How is everyone else configuring Docker storage for production systems? What have your experiences been like so far?

== Commands ==

vgcreate docker-storage /dev/sdb1 /dev/sdb2
lvcreate -n docker-pool -L 2G docker-storage
lvcreate -n docker-poolmeta -L 500M docker-storage
lvconvert --type thin-pool --poolmetadata docker-storage/docker-poolmeta docker-storage/docker-pool

start docker:

/usr/bin/docker daemon
-H fd://
-H tcp://0.0.0.0:2375
–insecure-registry hostname.com:5000
–selinux-enabled=true
–storage-driver=devicemapper
–storage-opt dm.fs=xfs
–storage-opt dm.thinpooldev=/dev/mapper/docker–storage-docker—pool

Some blogs I’ve been reading:

Friends Don’t Let Friends Run Docker on Loopback in Production

Managing Storage with Docker Formatted Containers on Red Hat Enterprise Linux
https://access.redhat.com/articles/1492923

1 Like

Hi,

I configured docker acc. to its documentation for systemd.
http://10sa.com/sql_stories/?p=1025

On CentOS 7.1, I did the following (not sure if it is the right way though)

  1. create a volume group called vg_data
  2. added this into /etc/sysconfig/docker-storage-setup

VG=vg_data DATA_SIZE=250G
3. run command docker-storage-setup
4. rm -r /var/lib/docker
5. systemctl start docker

when I do vg_display -v vg_data I see that a LV docker-pool was created. docker info seems also OK

I just set up a fresh CentOS 7.1 VM and installed docker as shown in https://docs.docker.com/engine/installation/linux/centos/

I do not see docker-storage-setup (the program) anywhere. What did you have to do to get docker-storage-setup on CentOS?

I have the same question.

I installed Docker 1.12 on a CentOS 7.2 host, and docker-storage-setup is nowhere to be found.

Searching with yum provides */docker-storage-setup only shows utilities from the CentOS extras repository, not from the Docker repo. None of the RPMs at https://yum.dockerproject.org/repo/main/centos/7/ seem to provide docker-storage-setup.

Where can we find this utility?

1 Like

In Fedora 25, this is what I have - it’s not a package, it’s a service.

rpm -q -i -f /usr/lib/systemd/system/docker-storage-setup.service
Name : docker
Epoch : 2
Version : 1.12.4
Release : 6.git1b5971a.fc25
Architecture: x86_64
Install Date: Fri 16 Dec 2016 02:07:44 AM EST
Group : Unspecified
Size : 63427735
License : ASL 2.0
Signature : RSA/SHA256, Wed 14 Dec 2016 10:32:33 AM EST, Key ID 4089d8f2fdb19c98
Source RPM : docker-1.12.4-6.git1b5971a.fc25.src.rpm
Build Date : Wed 14 Dec 2016 09:26:11 AM EST
Build Host : buildvm-05.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager : Fedora Project
Vendor : Fedora Project
URL : GitHub - projectatomic/docker: Docker - the open-source application container engine
Summary : Automates deployment of containerized applications

Since Fedora 25 is systemd-based, the service name is “docker-storage-setup.service”.

Hope this helps someone. I’m just getting docker set up here too, and want to avoid devicemapper too.

Missing docker-storage-setup

installed docker-engine-1.12.5-1.el7.centos.x86_64 on CentOS 7.3 host, and docker-storage-setup is nowhere to be found.

Searching with yum provides */docker-storage-setup only shows utilities from the CentOS extras repository, not from the Docker repo

Can this script be installed direct from https://github.com/projectatomic/docker.git and made to work with Centos7. When can we expect this script to be availble for 1.12?

Hi,

I am using Centos 7 and docker 1.13 and missing docker-storage-setup. Is there any way to change the storage drive ?

I think docker-storage-setup is installed automatically on red-hat and fedora there is no more additional package. You can find it with (at least on my fedora)

systemctl status docker-storage-setup

before starting the service and docker for the first time you typically have to add the volume group you plan to use in /etc/sysconfig/docker-storage-setup

Docker-storage-setup is installed with ‘docker’ and ‘docker-latest’ from the centos and redhat extras repo. Instructions for using can be found at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/managing_containers/managing_storage_with_docker_formatted_containers

Thanks
Billy

Where is the link for the CentOS rpm for docker-storage-setup?

[root@openshift_vm bin]# yum whatprovides docker-storage-setup
.
.
.
docker-1.13.1-53.git774336d.el7.centos.x86_64 : Automates deployment of containerized applications
Repo : extras
Matched from:
Filename : /usr/bin/docker-storage-setup

CentOS Linux release 7.5.1804 (Core)
NAME=“CentOS Linux”
VERSION=“7 (Core)”
ID=“centos”
ID_LIKE=“rhel fedora”
VERSION_ID=“7”

overlay2 is now the preferred Linux storage driver… and not devicemapper.

devicemapper is supported, but requires direct-lvm for production environments, because loopback-lvm , while zero-configuration, has very poor performance. devicemapper was the recommended storage driver for CentOS and RHEL, as their kernel version did not support overlay2 . However, current versions of CentOS and RHEL now have support for overlay2 , which is now the recommended driver.