Just some basic docker commands:
Guide
Manage images
List images
Code Block |
---|
docker image ls |
Remove images
Remove all dangling images (e.
...
g. those that are not tagged or referenced by a container):
Code Block |
---|
docker image prune |
Remove all images not use by an existing container:
Code Block |
---|
docker image prune -a |
Manage containers
List containers
...
Code Block |
---|
docker <start|stop|restart> <container> |
Remove container
Code Block |
---|
docker rm <container> |
The below will stop and remove (delete) a container
Code Block |
---|
docker rm -f <container> |
List container port mappings
...
Code Block |
---|
docker cp <container>:/file/path/within/container /host/path/target |
Interactively log into container with bash
Code Block |
---|
|
docker exec -it <container> /bin/bash |
Cleaning
Warning |
---|
This will delete all stopped containers, all networks not used, all dangling images, and all build cache: |
Code Block |
---|
docker system prune |
References
- https://docs.docker.com/
- https://stackoverflow.com/questions/22049212/copying-files-from-docker-container-to-host
...