0% found this document useful (0 votes)
366 views

Build Share: Docker Cheat Sheet

This document provides a cheat sheet for common Docker commands organized into categories of building, sharing, running, and managing Docker images and containers. It lists commands for building an image from a Dockerfile, pulling or pushing images to registries, running containers with options to expose ports and name containers, stopping and deleting containers, and managing networks, images, and other Docker resources. The cheat sheet acts as a quick reference guide for the most common Docker commands and their basic usage.

Uploaded by

Rpl Marseille
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
366 views

Build Share: Docker Cheat Sheet

This document provides a cheat sheet for common Docker commands organized into categories of building, sharing, running, and managing Docker images and containers. It lists commands for building an image from a Dockerfile, pulling or pushing images to registries, running containers with options to expose ports and name containers, stopping and deleting containers, and managing networks, images, and other Docker resources. The cheat sheet acts as a quick reference guide for the most common Docker commands and their basic usage.

Uploaded by

Rpl Marseille
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Docker Cheat Sheet

Build Share Docker Management


Build an image from the Dockerfile in the Pull an image from a registry All commands below are called as options to the base
current directory and tag the image
 docker pull myimage:1.0
docker build -t myimage:1.0 .
docker command. Run docker <command> --help
Retag a local image with a new image name for more information on a particular command.
List all images that are locally stored with and tag
the Docker Engine
 docker tag myimage:1.0 myrepo/
myimage:2.0
docker image ls app* Docker Application
Push an image to a registry assemble* Framework-aware builds (Docker Enterprise)
Delete an image from the local image store

docker push myrepo/myimage:2.0
docker image rm alpine:3.4 builder Manage builds
cluster Manage Docker clusters (Docker Enterprise)
config Manage Docker configs
context Manage contexts

Run engine
image
Manage the docker Engine
Manage images
network Manage networks
Run a container from the Alpine version 3.9 List the running containers (add --all to node Manage Swarm nodes
image, name the running container include stopped containers) plugin Manage plugins
“web” and expose port 5000 externally, docker container ls
mapped to port 80 inside the container. registry* Manage Docker registries
docker container run --name web -p Delete all running and stopped containers secret Manage Docker secrets
5000:80 alpine:3.9 docker container rm -f $(docker ps -aq)
service Manage services
Stop a running container through SIGTERM Print the last 100 stack Manage Docker stacks
docker container stop web lines of a container’s logs swarm Manage swarm
docker container
Stop a running container through SIGKILL logs --tail 100 web system Manage Docker
docker container kill web template* Quickly scaffold services (Docker Enterprise)
List the networks trust Manage trust on Docker images
docker network ls volume Manage volumes

*Experimental in Docker Enterprise 3.0.

www.docker.com

You might also like