Jump to navigation Jump to search


Docker CE

From deb packages

# cleanup
apt-get autoremove --purge docker* containerd\\.io*
# dependencies
apt-get install iptables procps git xz-utils
# packages
cd /tmp
curl -OL
curl -OL
curl -OL
dpkg -i containerd.io_1.2.6-3_amd64.deb docker-ce-cli_19.03.0~3-0~debian-stretch_amd64.deb docker-ce_19.03.0~3-0~debian-stretch_amd64.deb
rm -f *.deb

From docker repository

su -
apt-get install      apt-transport-https      ca-certificates      curl      gnupg2      software-properties-common
curl -fsSL | apt-key add -
add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
etckeeper commit
apt-get update
apt-get install docker-ce
# test
docker run hello-world

Docker Compose (optional)

From debian repository

apt-get install docker-compose
# or form a backports
apt-get -t stretch-backports install docker-compose

From pip

pip install docker-compose --user

From docker documentation

su -
curl -L$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod 0755 /usr/local/bin/docker-compose
docker-compose --version

User permissions

su -
# docker-ce already create docker group
# so we need to add normal users to this group if them can run docker images
usermod -aG docker <USERNAME>

Test and Run

# update current user permission reloading bash shell, for not shells you will need to log off and login again
exec su $USER
# test
docker run hello-world
# download and run a basic image
docker run -it --name deb-stretch debian:stretch /bin/bash