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!
  • Tweet

9 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. Pingback: A Simple Java EE Docker Example | Rafael Pestano
  3. 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.

  4. Pingback: 一个简单的Java EE&Docker示例 - Java吧
  5. Pingback: JBoss on Docker At a Glance | Red Hat Developer Blog
  6. 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.

  7. Pingback: Docker MySQL Persistence (Tech Tip #83) | Social Marketing by I88.CA
  8. We have many option to get more xbox gold codes but i would like to choose xbox live membership codes.

Leave a Reply

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