Docker Engine and Compose Install Debian 10
Published: 2020-12-12
Intro
Docker and docker-compose are a very common tools for developing and deploying applications.
In this post I will cover the process of installing Docker engine and Docker compose on Debian 10 minimal.
Software Used In This Post
- Debian Minimal - 10.7 Buster
- Docker Engine CE - 19.03.14
- Docker Compose - 1.27.4
Pre-Flight Check
Ensure that there are no default versions of Docker install. There should not be, but it's worth confirming.
apt list --installed | egrep "(docker|container)"Docker Install
Add the required APT repositories.
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-commonAdd the GPG key.
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -Verify the GPG key matches the key listed in the docks.
sudo apt-key fingerprint 0EBFCD88
# Output
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb) <[email protected]>
sub 4096R/F273FCD8 2017-02-22Add the required APT repositories.
sudo add-apt-repository -y \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"Install Docker, the CLI tools and containerd.
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.ioConfirm the docker service is started and enabled.
systemctl enable docker
# Output
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-12-12 06:07:54 AEST; 6min agoDocs: https://docs.docker.com
Main PID: 4750 (dockerd)
Tasks: 10
Memory: 48.1M
CGroup: /system.slice/docker.service
└─4750 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sockAdd your user to docker group.
sudo usermod -aG docker $USERNow logout and log back in or run the newgrp docker command.
Verify Docker Install
Confirm that you can run docker commands.
docker pull hello-world
# Output
Using default tag: latest
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latestDocker Compose Install
Install the docker-compose binary from the Github release page.
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composeMake the docker-compose binary executable.
sudo chmod +x /usr/local/bin/docker-composeSymlink the docker-compose binary into a location in your $PATH.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-composeUpdate the docker-compose binaries permissions.
sudo chgrp docker /usr/local/bin/docker-compose
sudo chmod 750 /usr/local/bin/docker-composeVerify Docker Compose Install
Confirm that you can run docker-compose commands.
docker-compose --version
# Output
docker-compose version 1.27.4, build 40524192Outro
This post covered the process of installing Docker engine and Docker compose on Debian 10 Minimal.
Links
https://docs.docker.com/engine/install/debian/