Docker
When we refer to containers, we almost always mean Docker containers (https://www.docker.com/). Docker is the most popular software tool for running programs in containers, which are isolated environments.
Containerization is a kind of virtualization where the scope of the application’s resources is limited. This means the application works at its maximum performance level. This is different from full virtualization, where you have to run the full operating system with the corresponding overhead and run your application inside that isolated operating system.
Arch Installation
pacman -S docker
systemctl start docker.service
If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group:
Create the docker group.
sudo groupadd docker
Add your user to the docker group.
sudo usermod -aG docker ${USER}
To apply the new group membership, log out of the server and back in, or type the following:
su - ${USER}
You will be prompted to enter your user’s password to continue.
Confirm that your user is now added to the docker group by typing:
(base) yanboyang713@boyang:~/Documents/docker-as-dev-environment$ id -nG
yanboyang713 adm cdrom sudo dip plugdev lpadmin sambashare microk8s docker
If you need to add a user to the docker group that you’re not logged in as, declare that username explicitly using:
sudo usermod -aG docker username
The rest of this article assumes you are running the docker command as a user in the docker group. If you choose not to, please prepend the commands with sudo.
sudo systemctl status docker.service
sudo systemctl start docker.service
sudo systemctl status docker.service
sudo systemctl enable docker.service
Let’s explore the docker command next.
Test Docker
docker info