Installing Docker on various systems

RHEL/CentOS

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 \
    https://download.docker.com/linux/centos/docker-ce.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

Slackware

install Docker CE,

#git clone https://github.com/docker/docker-ce.git
wget https://download.docker.com/linux/static/stable/x86_64/docker-17.12.0-ce.tgz
tar xzf docker-17.12.0-ce.tgz 
cd docker/
cp * /usr/bin/

and if you also need Compose,

cd ../
git clone https://github.com/docker/compose.git
cd compose/
pip install -U -r requirements.txt
python setup.py 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

ref. https://docs.docker.com/engine/installation/linux/docker-ce/binaries/#prerequisites

Ubuntu

apt update
apt install docker.io
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