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 USER

Slackware

grab the latest also available on github as release tag

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

and if you also need Compose,

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 -n dockerd:
nohup /usr/local/bin/dockerd > /root/dockerd.log 2> /root/dockerd.error.log &
pgrep -a docker
docker ps -a

and (rc.local_shutdown),

echo -n killing dockerd...
pkill dockerd && echo done || echo FAIL

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

Ubuntu

Docker CE,

apt-get remove docker docker-engine docker.io
apt-get autoremove
dpkg -l | grep ^rc

apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu `lsb_release -cs` stable"
apt-get install docker-ce

docker ps -a

Docker.io,

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

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

Resources

Install Docker Engine from binaries https://docs.docker.com/engine/install/binaries/