Sunteți pe pagina 1din 4

In my previous article, we already have learnedwhat is docker its architecture and what is

thedifference between Docker and Kubernetes. In this article, we will discuss some of the
frequently used docker commands along with its purpose.

Below is the list of most frequently used docker commands.

Docker Command Purpose


docker --version This command will give the
installed docker version.
docker build <path to This will build an image from a
docker file> specified docker file.
docker pull <image This will pull images from
name> the docker repository.
docker create This will create a new docker
container.
docker run -it -d httpd This will create a docker
container in which the Apache
HTTP server will run.
docker ps This command will list the
running containers.
docker ps-a This will display all the docker
containers
running/exited/stopped with
container details.
docker exec -it This will access the docker
<container id> bash container and run commands
inside the container.
docker rm <container This command will remove the
id> docker container with
container id mentioned in the
command.
docker stop <container This command will stop the
id> running container.
docker rm <container This command will remove the
id> container for the mentioned
container id.
docker rmi <docker This command will remove
image id> docker image for the provided
docker image id.
docker kill <container This command will kill running
id> container.
docker restart This command will restart the
<container id> docker container with the
provided container id.
docker start <container This command will start the
id> docker container for the
provided container id.
docker stop <container This command will stop the
id> docker container for the
provided container id.
docker login This command will login into
docker hub.
docker logout This command will logout from
docker hub.
docker rename <old This command will rename the
container id> <new docker container from old to
container id> new container id.
docker pause This command will pause the
<container id> processes for the provided
container id.
docker network ls This command will list all the
network in the coder cluster.
docker info This command will display the
system-wide information.
docker history <image This command will list the
name> history of docker image with
the provided image id.
docker logs <container This command will show the
id> logs of the docker container
with the provided container id.
docker search <image This command will search the
name> docker hub for the mentioned
image name.
docker engine This command will manage the
docker engine.

S-ar putea să vă placă și