Docker Cheat Sheet

General Commands

# Start the docker daemon
docker -d

# Get help with Docker. Can also use –help on all subcommands
docker --help

# Display system-wide information
docker info

Images

Docker images are a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings

# Build an Image from a Dockerfile
docker build -t <image_name> 

# Build an Image from a Dockerfile without the cache
docker build -t <image_name> . –no-cache 

# List local images
docker images 

# Delete an Image
docker rmi <image_name> 

# Remove all unused images
docker image prune 

Docker Hub

Docker Hub is a service provided by Docker for finding and sharing container images with your team. Learn more and find images at https://hub.docker.com

Containers

A container is a runtime instance of a docker image. A container will always run the same, regardless of the infrastructure. Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging.

Source: https://docs.docker.com/get-started/docker_cheatsheet.pdf

Last updated

Was this helpful?