Site icon TestingDocs.com

Most Useful Docker Commands

Overview

In this tutorial, we will learn the most frequently used Docker commands when working with Docker containers.

Docker commands

Docker Command  Command description
$ docker –version This command is used to find the Docker version.
$ docker start <container_name> This command is used to start the docker container.
$ docker stop <contaner_name>  This command is used to stop the running docker container.
$ docker kill <contaner_name>  This command is used to kill a docker container. This is a non-graceful way to stop a docker container.
$ docker top <contaner_name>  This command is used to list the running processes within a docker container.

 

docker –version

\> docker –version

This command displays the docker version and exits. This command is useful to know the docker version.

docker build

The build command builds a docker image from the Docker file.

\> docker build [OPTIONS] PATH

docker pull

pull command is used to pull a docker image from the docker registry.

\> docker pull  <image name>

The Docker push command is the reverse of the pull command. The push command is used to push an image to a registry. For understanding, these commands are like git pull and push.

docker images

\> docker images

This command is used to list the Docker images in the local repository.

docker ps

\> docker ps

This command is used to list the Docker containers.

docker run

\> docker run <command>

This command is used to run the command in the Docker container.

Run Selenium Test on Docker Container

Some command examples are shown in the following tutorial:

https://www.testingdocs.com/run-selenium-test-on-docker-container/

Official Website

More information on Docker can be found on the Docker official website at::

https://www.docker.com/

Exit mobile version