...
All running containers start from some base image. You can find lots of open source images at Docker Hub including basic OSes (ubuntu, centos), popular database engines (postgres, mysql) and others.
- 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>
Containers
- To run a container with its default command, use:
docker run <image-name>
- 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:
|