Docker Common Commands Cheatsheet (Tech Tip #59)

Docker CLI provides a comprehensive set of commands. Here is a quick cheat sheet of the commonly used commands:

Purpose Command
Build an image docker build –rm=true .
Install an image docker pull ${IMAGE}
List of installed images docker images
List of installed images (detailed listing) docker images –no-trunc
Remove an image docker rmi ${IMAGE_ID}
Remove all untagged images docker rmi $(docker images | grep “^” | awk “{print $3}”)
Remove all images docker rm $(docker ps -aq)
Run a container docker run
List containers docker ps
Stop a container docker stop ${CID}
Find IP address of the container docker inspect –format ‘{{ .NetworkSettings.IPAddress }}’ ${CID}
Attach to a container docker attach ${CID}
Remove a container docker rm ${CID}
Remove all containers docker rm $(docker ps -aq)

What other commands do you use commonly ?

Be Sociable, Share!

7 thoughts on “Docker Common Commands Cheatsheet (Tech Tip #59)

  1. Hi,
    Really interesting blog.
    I am a developer with some minor Devops tasks :)
    Your Docker posts are really helpful.

    One thing though,
    Is there a way to subscribe to your blog with RSS?

  2. There’s one error in your list. The “Remove all images” task should be named “Remove all containers” since docker rm $(docker ps -aq) removes containers, not images.

  3. Miami has many lenders who provide these short-term loans for the unemployed, nevertheless, you will need to use your vehicle as collateral for your car title loan.

    Most interest rates on these plans are less than the eye rates on credit cards.

Leave a Reply

Your email address will not be published. Required fields are marked *