• Blog
  • Changelog
  • codesue

  • About
  • Contact

codesue

Docker Cheatsheet for Beginners

July 5, 2021

This cheatsheet is a reference for Docker beginners who want to quickly get started running and inspecting containers. For a comprehensive introduction to Docker, read the Docker overview guide and complete the Getting Started with Docker tutorial.

About Docker

Docker is a platform for developing, shipping, and running applications. It allows you to package and run applications in isolated environments called containers. Docker containers are created from read-only templates called images. Docker images are hosted in registries, such as Docker Hub.

Basic Commands

Running and Inspecting Containers

Pull an image from a registry:

$ docker pull <image>

List local images:

$ docker images

Run a container:

$ docker run <container>

Run a container in the background:

$ docker run -d <container>

List currently running containers:

$ docker ps

List all containers:

$ docker ps -a

List currently running containers and their resource usage statistics:

$ docker stats

Show a container’s logs:

$ docker logs <container>

Show a container’s metadata:

$ docker inspect <container>

Stop a container:

$ docker stop <container>

Cleaning up stopped containers and unused images

Remove a stopped container’s metadata:

$ docker rm <container>

Remove the metadata of all stopped containers:

$ docker container prune -f

Remove an image:

$ docker rmi <image>

Remove all unused images:

$ docker image prune --all
TAGS:beginnercheatsheetdocker
0 Comments
Share

Leave a Comment Cancel Comment

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

You May Also Like

February 22, 2022

Readings in Machine Learning Engineering

July 3, 2017

Printing “Hello, World!”

Hi, I’m Sue šŸ‘‹
Hi, I’m Sue šŸ‘‹

Hi, I’m Sue šŸ‘‹

I’m a software engineer who builds tools that empower people to do their best work. I enjoy studying linguistics and hacking on tech that makes learning languages fun and approachable.

  • Blog
  • Changelog
  • About
  • Contact

COPYRIGHT Ā© 2022 SUZEN FYLKE. Site Designed by Pix & Hue.