Docker Cheat Sheet
Docker Cheat Sheet
Online
Docker
Cheat Sheet
Docker Cheat Sheet 1
Use Code
Clean Up Commands
Clears all images that are not being used by Removes a running container
containers
Unpauses a container
docker logs -ft container
docker restart container Follows container logs
Restarts a container
docker exec -ti container script.sh
docker wait container Runs a command in a container
Blocks a container
docker commit container image
docker export container Creates a new image from a container
docker -ps -a
docker logs container
Lists all containers
Gathers the logs for a container
Tags an image
Run Commands
Docker uses the run command to create containers from provided images. The default syntax for this
command:
--detach , -d --network
--rm
--env , -e
Removes container when it stops
Sets environment variables
--read-only
--hostname , -h
Sets the container filesystem as read-only
Sets a hostname to a container
--workdir , -w
--label , -l
Sets a working directory in a container
Creates a meta data label for a container
--name
Registry Commands
Logs out from a registry Searches Docker Hub for images with the
specified term
Service Commands
Updates a service
Network Commands