Docker Management

docker app*Docker Application
docker assemble*Framework-aware builds (Docker Enterprise)
docker builderManage builds
docker clusterManage Docker clusters (Docker Enterprise)
docker configManage Docker configs
docker contextManage contexts
docker engineManage the docker Engine
docker imageManage images
docker networkManage networks
docker nodeManage Swarm nodes
docker pluginManage plugins
docker registry*Manage Docker registries
docker secretManage Docker secrets
docker serviceManage services
docker stackManage Docker stacks
docker swarmManage swarm
docker systemManage Docker
docker template*Quickly scaffold services (Docker Enterprise)
docker trustManage trust on Docker images
docker volumeManage volumes
Run docker –help for more information on a particular command.

Docker Hub Cheat Sheet

docker search searchtermSearch Docker Hub for images.
docker pull user/imageDownloads an image from Docker Hub.
docker loginAuthenticate to Docker Hub
(or other Docker registry).
docker push user/imageUploads an image to Docker Hub.
You must be authenticated to run this command.

Docker Build Command Cheat Sheet

docker build -t myimage:1.0 .Build an image from the Dockerfile in the
current directory and tag the image
docker image lsList all images that are locally stored with
the Docker Engine
docker image rm alpine:3.4Delete an image from the local image store

Docker Share Command Cheat Sheet

docker pull myimage:1.0Pull an image from a registry
docker tag myimage:1.0 myrepo/
Retag a local image with a new image name
and tag
docker push myrepo/myimage:2.0Push an image to a registry

Docker Run Command Cheat Sheet

docker container run --name web -p
5000:80 alpine:3.9
Run a container from the Alpine version 3.9
image, name the running container
“web” and expose port 5000 externally,
mapped to port 80 inside the container.
docker container stop webStop a running container through SIGTERM
docker container kill webStop a running container through SIGKILL
docker network lsList the networks
docker container lsList the running containers (add –all to
include stopped containers)
docker container rm -f $(docker ps -aq)Delete all running and stopped containers
docker container
logs --tail 100 web
Print the last 100
lines of a container’s logs

Docker View Infomation

docker psList all running containers.
docker ps -aList all container instances, with their ID
and status.
docker imagesLists all images on the local machine.
docker history user/imageLists the history of an image.
docker logs [container name or ID]Displays the logs from a running container.
docker port [container name or ID]Displays the exposed port of a running container.
docker diff [container name or ID]Lists the changes made to a container.