(basic / useful) Docker commands

Disclaimer: This is a list of commands/options I found most useful in my day-to-day activities, there are many commands/options available, you may find other commands/options more useful or use them in another way.

Basic ( runtime check )

docker -v
docker info

Basic ( listing )

docker ps (containers running)
docker ps -a (last run containers)
docker images (existing images)

Basic (creating / deleting )

docker pull [image name]
docker run -it [image name] [command] (runs a command in a container based on an image) 
docker stop [container name] (stops the container)
docker start -ai [container name] (starts the container)
docker stop $(docker ps -a -q) (stops all containers using ID)
docker exec -it [container name] [command]
docker container top [container name]
docker rm [container name] (removes a container)
docker container prune (removes all stopped containers)
docker rmi [image name] (removes the image)
docker rmi $(docker images -q) (removes all images using ID)
docker image prune (removes unused images)

What are your most useful commands?

This entry was posted in docker. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.