Chapter 9 Docker Command Line Interface (CLI)
docker --help- Show all docker commands
docker --version- Show the Docker version information - Good for verifying that docker is installed
DockerHub (https://hub.docker.com/) contains many pre-built images that other users and organizations have created.
These commands are useful for connecting to a remote Docker registry to download docker images.
login- Log in to a Docker registry
logout- Log out from a Docker registry
search- Search the Docker Hub for images
push- Push an image or a repository to a registry
pull- Pull an image or a repository from a registry
commit- Create a new image from a container’s changes
docker container --help to list all “container management” commands. These are the common commands.
run- Run a command in a new container
ps- List running containers (I use
docker container ls, which does the same thing)
stop- Stop one or more running containers
start- Start one or more stopped containers
rm- Remove one or more containers (I use
docker container rm, which does the same thing)
docker image --help to list “image management” commands.
build- Build an image from a Dockerfile
tag- Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
images- List images (I use
docker image ls, which does the same thing)
rmi- Remove one or more images (I use
docker image rm, which does the same thing)