In this blog, describe the Docker Commands that you will be using frequently while you are working with Docker. to manage the Docker container in the severs The base command for the Docker CLI.
$ docker version
Show the Docker all version information in an easy to read layout. If a format is specified, the given template will be executed instead
$ docker pull
Pull an image or a repository from a registry, Docker Hub contains many pre-built images that you can pull and try without needing to define and configure your own.
$ docker run
Run a command in a new container, a writeable container layer over the specified image, and then starts it using the specified command.
$ docker ps
To list all running containers:
$ docker ps -a
This command is used to show all the running and exited containers
$ docker exec
the docker exec command runs a new command in a running container.
$ docker login
Log in to a Docker registry any public or private repository for which you have credentials.
$ docker commit
To commit a container’s file changes or settings into a new image. This allows you to debug a container by running an interactive shell or to export a working dataset to another server.
$ docker push
docker push to share your images to the Docker Hub registry or to a self-hosted one.
$ docker images
docker images will show all top-level images, their repository and tags, and their size.
$ docker stop
The main process inside the container Stop one or more running. will receive SIGTERM, and after a grace period, SIGKILL.
$ docker rm
Removes the container referenced under the link
$ docker rmi
Removes (and un-tags) one or more images from the host node. If an image has multiple tags, using this command with the tag as a parameter only removes the tag.
$ docker build
docker build command builds Docker images from a Dockerfile and a “context”. A build’s context is the set of files located in the specified PATH or URL
This Blog of commonly used Docker commands should useful you become more familiar with them. The command will be helpful to create and manage containers
How install Docker: https://www.linuxworld.xyz/docker-install-in-ubuntu-16-and-18/
Create the Dockerfile :https://www.linuxworld.xyz/how-to-create-the-container-dockerfile/