sudo apt-get remove docker docker-engine docker.io containerd runc
sudo mv -f /etc/systemd/system/docker.service.d/systemd_docker.conf /root/etc_systemd_system_docker.service.d_systemd_docker.conf-$(date --iso-8601=seconds)
sudo mv -f /etc/default/docker /root/etc_default_docker-$(date --iso-8601=seconds)
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-cache madison docker-ce docker-ce-cli
# Create json config for docker:
mkdir -p /etc/docker/
cat <<EOF >/etc/docker/daemon.json
{
"dns": ["8.8.8.8", "8.8.4.4"],
"iptables": false
}
EOF
apt-mark unhold docker-ce
export DOCKER_VERSION=5:18.09.5~3-0~ubuntu-xenial
sudo apt-get install docker-ce=$DOCKER_VERSION docker-ce-cli=$DOCKER_VERSION containerd.io
apt-mark hold docker-ce
Note 1: mark on hold to prevent auto upgrades Note 2: docker-ce-cli appeared >= 18.09
systemctl daemon-reload
systemctl status docker