Hello Docker

2024-03-05
2021-10-31

I'm going to write down the very basic usage of Docker, because I forget it every time I use it.

Retrieve the container image

Retrieve the container image from Docker Hub.

terminal

$ docker pull <repository>

Show the list of the containers

terminal

$ docker images

Create and run the container

terminal

$ docker run -it <repository>

Show the running containers

terminal

$ docker ps

Use -a option to show sleeping containers as well.

terminal

$ docker ps -a

Run the created container

terminal

$ docker start <container id or name>

Stop the container

terminal

$ docker stop <container id or name>