KEMBAR78
Docker Cheat Sheet | PDF | File System | Software Engineering
0% found this document useful (0 votes)
113 views1 page

Docker Cheat Sheet

This document provides a cheat sheet summarizing common Docker commands and Dockerfile instructions. It lists commands for working with images, containers, and Dockerfiles. It also describes the purpose and function of key Dockerfile instructions like FROM, RUN, CMD, EXPOSE, ENV, ADD, COPY, ENTRYPOINT and others. The cheat sheet is intended to serve as a quick reference guide for common Docker tasks and the instructions used to build Docker images.

Uploaded by

lbb1987
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)
113 views1 page

Docker Cheat Sheet

This document provides a cheat sheet summarizing common Docker commands and Dockerfile instructions. It lists commands for working with images, containers, and Dockerfiles. It also describes the purpose and function of key Dockerfile instructions like FROM, RUN, CMD, EXPOSE, ENV, ADD, COPY, ENTRYPOINT and others. The cheat sheet is intended to serve as a quick reference guide for common Docker tasks and the instructions used to build Docker images.

Uploaded by

lbb1987
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 Cheat Sheet

by rishabkumar7 via cheatography.com/132291/cs/38939/

General Commands Dockerfile Instru​ctions (cont)

docker version Shows the Docker version inform​ation VOLUME Create a mount point with the specified name and
docker info Display system​-wide inform​ation mark it as holding externally mounted volumes from
native host or other containers
docker help <co​mma​nd> Shows help for a specific command
USER Set the user name or UID to use when running the
Image Commands image and for any RUN, CMD and ENTRYPOINT
instru​ctions that follow it in the Dockerfile
docker images List images
WORKDIR Sets the working directory for any RUN, CMD,
docker pull <im​age> Pull an image or a repository from a registry
ENTRYP​OINT, COPY and ADD instru​ctions that follow
docker rmi <im​age> Remove one or more images it in the Dockerfile

Container Commands Dockerfile Commands


docker ps Lists running containers docker build -t <ta​g> Build an image from a Dockerfile in the
docker ps -a List all containers (both running and current directory
stopped) docker tag <im​age> Tag an image to a name (local or registry)
docker run <im​age> Run a command in a new container <ta​g>
docker start Start one or more stopped containers
docker restart Restart one or more containers
docker stop <co​nta​ine​‐ Stop one or more running containers
r>
docker rm <co​nta​ine​r> Remove one or more containers
docker rename Rename a container

Dockerfile Instru​ctions

FROM Set the Base Image for subsequent instru​ctions


RUN Execute any commands in a new layer on top of
the current image and commit the results
CMD Provide defaults for an executing container
EXPOSE nform Docker that the container listens on the
specified network ports at runtime

ENV Set enviro​nment variables


ADD Copy new files, direct​ories or remote file URLs
from <sr​c> and add them to the filesystem of the
image at the path <de​st>
COPY Copy new files or direct​ories from <sr​c> and add
them to the filesystem of the container at the path
<de​st>
ENTRYPOINT Allows you to configure a container that will run as
an executable

By rishabkumar7 Published 25th May, 2023. Sponsored by CrosswordCheats.com


Last updated 25th May, 2023. Learn to solve cryptic crosswords!
Page 1 of 1. http://crosswordcheats.com

cheatography.com/rishabkumar7/

You might also like