sudo apt-get update
sudo 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 -
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 install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable"
sudo apt-get update
sudo apt-get install docker-ce
Local user: sudo usermod -aG docker $USER
Jenkins user: sudo usermod -aG docker jenkins-node
sudo reboot
(Important for Linux machines, as it will try to download everything in /etc/
, that will not work for more than 3 containers.) For more details please check this article.
Create a directory and file:
sudo systemctl stop docker
sudo mkdir /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/docker.conf
Add this in docker.conf (sudo vi /etc/systemd/system/docker.service.d/docker.conf
):
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --graph="/virtual/docker" --storage-driver=devicemapper --storage-opt dm.basesize=20G
Reload docker:
sudo systemctl daemon-reload
sudo systemctl start docker
Useful Docker cleanup commands.