...
- To download an image from Docker Hub, use:
docker pull <image-name>
- To list available images, use:
docker images
- To remove image, use:
docker rmi <image-name>
Example 1. Pulling an image
Containers
- To run a container, use:
docker run <image-name> <command>
- To list containers, use:
docker ps
- To copy a file from/into a running container, use:
docker cp <file-1> <file-2>
- To execute a command in a running container, use:
docker exec <container-id> <command>
- To remove container, use:
docker rm <container-id>
Info | ||
---|---|---|
| ||
Each command supports additional flags passed along the main arguments. Please make sure to check The most often used flags are:
|
Examples
Pulling an image
Example 2. Starting a container
Exercises
Checking /etc/os-release of different containers
...