Basic Docker commands are essential for managing containers and images. They enable tasks such as running containers, listing running containers, managing images, stopping containers, removing containers, and interacting with containers. These commands facilitate container deployment, monitoring, and maintenance.
Here is a docker commands list of the basic yet most widely used ones that help manage containers, images, and the overall Docker environment:
1. Docker management commands
The Docker management commands are general commands used to get system information or help from Docker CLI.
We will start with the command that lists all the other commands, docker --help
.
$docker --help
To get help from Docker.
docker --help
You can also use –help on all subcommands.
$docker info
To display Docker system-wide information.
docker info
$docker version
To display the current installed Docker version.
docker version
2. Docker Hub commands
Docker Hub is a service provided by Docker that hosts container images. You can download and even push your own images in Docker Hub, making it accessible to everyone connected to the service.
The Docker Hub related commands are:
$docker login
To login into Docker.
docker login -u <username>
$docker push
To publish an image to Docker Hub.
docker push <username>/<image_name>
$docker search
To search for an image in Docker Hub.
docker search <image_name>
For example, you can search for all images containing the work umami
, which is a self-hosted analytic platform
The command also returns the image rating and whether it is an official image provided by the product developers.
$docker pull
To pull an image from the Docker Hub.
docker pull
is one of the most common Docker commands:
docker pull <image_name>
To run a container, we need to first pull the container and then run it.