Photo by Ian Taylor on Unsplash
How to set up Docker on Deepin Linux OS 20.9 via the terminal emulator?
Table of contents
- Docker
- Check your OS (optional)
- Update packages info
- Install dependencies
- Download Docker GPG (GNU Privacy Guard) key
- Check Docker GPG key
- Add a new entry to the repository
- Update package info
- Install Docker
- Check installation
- Check status
- Configure Docker hello-world
- Run Docker hello-world
- Done
- Celebrate
- Let's become friends
- Final thoughts
Docker
Docker is a platform for developing, shipping, and running applications in containers.
Containers are lightweight, portable, and self-sufficient units that can package an application and its dependencies, including libraries and configuration files, into a single, consistent environment.
This allows developers to create, deploy, and manage applications more efficiently, regardless of the underlying infrastructure.
Let's get down to business
shall we?
Check your OS (optional)
This step is just to make sure you have Deepin Linux installed.
lsb_release -a
hostnamectl
cat /etc/os-release
uname -a
Output
Update packages info
sudo apt-get update
Running sudo apt-get update
is an important step before installing or upgrading packages on your system because it ensures that you have the most up-to-date information about available packages.
Without updating the package index, you might not see the latest versions of software or be able to install new packages that have been added to the repositories since the last update.
Install dependencies
sudo apt install apt-transport-https ca-certificates gnupg2 curl software-properties-common -y
Output
Download Docker GPG (GNU Privacy Guard) key
sudo curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
Output
Curl
is a command-line tool for transferring data with URLs. In this context, it is used to fetch data from the specified URL.
Check Docker GPG key
sudo apt-key fingerprint 0EBFCD88
Output
0EBFCD88
is the key ID or key fingerprint of the GPG key for which you want to retrieve information. In this case, 0EBFCD88
is typically the GPG key associated with the Docker repository.
The sudo apt-key fingerprint
command is used to display the fingerprint of a GPG key that has been added to the APT (Advanced Package Tool) keyring on a Debian-based Linux system. The fingerprint is a unique identifier for a GPG key, and it's used to verify the authenticity of the key.
Add a new entry to the repository
printf 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable\n'| sudo tee /etc/apt/sources.list.d/docker-ce.list
Output
Update package info
sudo apt-get update
Install Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
Output
docker-ce
is the package name for Docker CE (Community Edition), which is the version of Docker designed for community use and development environments.
Docker CE Command Line Interface (CLI) is available through the package docker-ce-cli
. It provides the command-line tools for working with Docker containers and images.
containerd.io
is the package name for containerd
, which is an essential component of the Docker runtime that manages containers and provides a basic infrastructure for container execution.
Check installation
docker --version
which docker
docker --help
Output
Check status
sudo systemctl status docker
Output
The command used to manage and control system services on Linux systems that use
systemd
as their init system issystemctl
.systemd
is a system and service manager commonly used in modern Linux distributions.
Configure Docker hello-world
sudo docker pull hello-world
Output
Run Docker hello-world
sudo docker run hello-world
Output
Done
Celebrate
Let's become friends
Final thoughts
Thank you for reading this article.
If you have any questions, thoughts, suggestions, or corrections, please share them with us.
We appreciate your feedback and look forward to hearing from you.
Feel free to suggest topics for future blog articles. Until next time!