Installing Docker
Instructions for installing Docker on Linux systems based on Debian.
Requirements
Operating System | Version |
---|---|
Debian | 10 |
Installation
Refresh the package index.
sudo apt-get update
Remove any previous Docker packages.
sudo apt-get remove docker docker-engine docker.io
Install the
docker.io
package from the official repositories.sudo apt-get install docker.io
Note: the installer creates a docker user group. Only users in that group can run Docker without superuser privileges.
Add your user to the docker group.
sudo usermod -a -G docker $USER
Restart the session (or the system) so the new group membership takes effect.
sudo reboot
Verification
Check the installed version.
docker --version
Docker version 18.09.1, build 4c52b90
Verify that the service is running.
sudo service docker status
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
Active: active (running) since Sat 2020-05-23 13:44:15 -04; 55s ago
Docs: https://docs.docker.com
Main PID: 5821 (dockerd)
Tasks: 14
CGroup: /system.slice/docker.service
└─5821 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
...
Run the hello-world
container to confirm the setup.
docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
...
Auto-start
Control whether the service starts automatically.
sudo systemctl enable docker
To disable auto-start:
sudo systemctl disable docker
References
Published: May 23, 2020