In this post, basically, I don’t put options. If you think this command is lacking something important, you will need to check Docker Doc(


pull command is almost same as git pull. Get an image to local from Docker hub.


push command is also the same as git push. This command uploads your Docker image to Docker Hub. This allows others to use your image or you can use the image from any machines. For example, you can use the image for CI. I’m using my own image for Circle CI to run the test.
The free plan allows us to have one private repo. You can make your image secure. The following: python3.7 is a tag. Generally, a community organization provides multiple versions of images.

For example, node:latest, node:11, node:10 etc.


This command is to create an image from Dockerfile. You can see what Docker file is in the following post.

ml_conda_docker is an image name & tag.


This command shows you images you have. I think I have used this command so many times lol


This command is to remove an images. Sometimes images are huge, so need to delete images especially when I create an image from container which is based on an image from Docker Hub.


This command creates a container but doesn’t start a container.


This command is to run a container or start a container.
You should check the options.
Also you can check my post about container(


ps could be your best friend when you use Docker.
This command shows you running containers’ information. If you want to see stopped containers, you can add -a.


This command allows us to create an image from a container. We can pull an image and add/install anything we need then do commit. After that, we can start run/create a container the image we committed.
One thing you should know is that commit creates a new image from the image you pulled and the size of the new one could be bigger than the based one. So, you need care about your storage if you don’t have enough storage on your machine.


This command is to start running a container.


This command is to stop a running container.


When you are in Docker container, you can use exit to get out there.


This command to attach local standard input, output, and error streams to a running container.


This command deletes a container which is not running. You can remove multiple containers if you put multiple container_ids

system prune

This command is to remove unused data.
If you really want to clean up your Docker environment, you can use -aoption. However, this option removes all unused data so be careful when you use this option.


This command allows us to exec another process in a running container.

Actually, there are so many commands you can use/should know, but I guess for a beginner like me these commands are kind of enough to learn the basics of Docker.

Hope this is useful for someone!

If something wrong or missing something important, please leave a comment!!!(I’m still learning Docker 😆)

Docker Doc

Docker cheat sheet

If you don’t like to use CLI, you can use Docker with GUI like kitematic(, but probably CLI could be helpful to understand Docker since we will need to write Dockerfile, docker-compose.yml.


Would love your thoughts, please comment.x