Installing Docker on various systems


Setup docker using the official docker repo, not EPEL.

Check that docker is not installed already,

ls -al /etc/yum.repos.d/
rpm -qa | grep -i docker

Install Docker Engine Community Edition on CentOS,

yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager \
    --add-repo \
yum makecache fast
yum install -y docker-ce
systemctl list-unit-files | grep docker
systemctl status docker
systemctl start docker
systemctl enable docker
usermod -a -G docker ceph


install Docker CE,

#git clone
tar xzf docker-17.12.0-ce.tgz 
cd docker/
cp * /usr/bin/

and if you also need Compose,

cd ../
git clone
cd compose/
pip install -U -r requirements.txt
python install

enable Docker CE (rc.local),

echo starting Docker CE
nohup dockerd > /root/dockerd.log 2> /root/dockerd.error.log &
ps auxw | grep docker
docker ps -a

and (rc.local_shutdown),

echo stopping Docker CE...
pkill dockerd && echo termination signal sent



apt update
apt install
systemctl list-unit-files | grep docker
systemctl enable docker.socket
systemctl enable docker.service
usermod -a -G docker ceph

Re-locate the docker files

    systemctl stop docker.service
    systemctl stop docker.socket

mv /var/lib/docker/ /data/docker/
ln -s ../../data/docker /var/lib/docker

    systemctl start docker.socket
    systemctl start docker.service

Ready to go

Check that everything works, as user,

docker ps