run anywhere. ◎ Developers can automate their build pipeline and share artifacts with Docker Hub. ◎ “Dockerized” apps are isolated from their surroundings. “W ” - M “I f USB ” - M “T f R 3.Y I R 3.X” - M 3
NAME[:TAG] Pull an image or a repository from Docker Hub to the machine. docker images Show all top level images, their repository and tags, and their size. docker rmi IMAGE Remove one or more images. 15
a COMMAND with specific ARGS in a new container. OPTIONS ◎ --detach, -d Run container in background and print container ID ◎ --env, -e Set environment variables ◎ --interactive, -i Keep STDIN open ◎ --name Assign a name to the container ◎ --publish, -p Publish a container’s port(s) to the host ◎ --rm Automatically remove the container when it exits ◎ --tty, -t Allocate a pseudo-TTY ◎ --volume, -v Bind mount a volume 17
running container. docker ps -a List the running containers. docker stop CONTAINER Stop one or more running containers. docker rm -f CONTAINER Remove one or more containers 23
Build an image from the Dockerfile in the current directory and tag it Publish 1. Retag a local image for a private registry 2. Log in to a registry (Docker Hub) 3. Push an image to the registry (upload) 28
from a Dockerfile. docker login [SERVER] Log in to a Docker registry docker push NAME[:TAG] Push an image or a repository to a registry docker tag SOURCE TARGET Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE 29