In the fascinating world of technology, there are times when we get a little tangled while trying new things. If you have heard of Docker, the popular container software, and feel intrigued but somewhat confused, do not worry. You are in the right place! In this article, I will guide you simply through getting started with Docker, including installation on different Linux distributions and basic management commands. Get ready to untangle your questions and embark on an exciting technological adventure.

Installing Docker on Different Linux Distributions

Below, I will show you the basic steps for installing Docker on the most popular Linux distributions:

Debian

On Debian, open a terminal and run the following commands one at a time:

sudo apt update
sudo apt install docker.io

Ubuntu

On Ubuntu, you can install Docker by running the following commands in a terminal:

sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker

RedHat:

On RedHat, the installation process is slightly different. Follow these steps:

sudo yum install docker
sudo systemctl start docker
sudo systemctl enable docker

SUSE

On SUSE, installation is performed through Zypper. Use the following commands:

sudo zypper install docker
sudo systemctl start docker
sudo systemctl enable docker
  1. Arch: On Arch Linux, the installation process is similar to that of other distributions:
sudo pacman -Syu docker
sudo systemctl start docker
sudo systemctl enable docker

Basic Docker Management Commands

Now that you have Docker installed, it is time to dive into basic management commands. These will help you create, run, and manage Docker containers. Here are some examples:

Creating a Container

To create a container, use the following command:

docker create --name mi-contenedor nombre-de-la-imagen
# Example:
docker create --name mi-web nginx

Starting a Container

To start a container, run the following command:

docker start nombre-del-contenedor
# Example:
docker start mi-contenedor

Stopping a Container

If you want to stop a running container, use the command:

docker stop nombre-del-contenedor
# Example:
docker stop mi-contenedor

Removing a Container

To remove a container, use the following command:

docker rm nombre-del-contenedor
# Example:
docker rm mi-contenedor

Viewing Running Containers

To see running containers, run the command:

docker ps

Viewing Stopped Containers

If you want to see both running and stopped containers, run this command:

docker ps -a

Conclusion

Congratulations! You have taken your first steps into the fascinating world of Docker. In this article, I showed you how to install Docker on different Linux distributions and provided some basic management commands. Remember that this is only the beginning and there is much more to discover. So break free and keep exploring! Soon you will be navigating containers and volumes without any trouble. Have fun learning!

I hope this article has been useful. Feel free to come back if you have more questions.