Reading Time: 2 minutes

Below are some of the most useful and commonly used Docker commands along with usage examples:
docker runThedocker runcommand is used to start a Docker container from an image. For example, if you want to start an Ubuntu container:
docker run ubuntu
docker psThedocker pscommand shows a list of all running containers. To display all containers (including those not running), you can use the-aoption.
docker ps
docker stopThedocker stopcommand is used to stop a running container. For example, if you want to stop a container with ID 123456789:
docker stop 123456789
docker rmThedocker rmcommand is used to remove a container. For example, if you want to remove a container with ID 123456789:
docker rm 123456789
docker imagesThedocker imagescommand shows a list of all downloaded Docker images on the system.
docker images
docker pullThedocker pullcommand is used to download a Docker image from a repository.
docker pull ubuntu
docker pushThedocker pushcommand is used to upload a Docker image to a repository.
docker push myrepository/myimage
docker buildThedocker buildcommand is used to build a Docker image from a Dockerfile.
docker build -t myimage .
docker-composeThedocker-composecommand is used to manage multiple Docker containers through a YAML file.
docker-compose up docker-compose down
docker execThedocker execcommand is used to execute a command in a running container.
docker exec -it mycontainer bash
These are just some of the most commonly used and useful Docker commands. There are many more commands and options available in Docker, and more details can be found in the official Docker documentation.
