mirror of
https://github.com/wsargent/docker-cheat-sheet.git
synced 2025-09-22 05:40:50 +02:00
Update README.md
added hint to use -v for removal of volumes associated with the container when deleting it (to avoid orphaned volume folders on the host)
This commit is contained in:
parent
cf2f2be8ea
commit
51402f4770
1 changed files with 2 additions and 0 deletions
|
@ -112,6 +112,8 @@ If you want to run and then interact with a container, `docker start`, then spaw
|
||||||
|
|
||||||
If you want a transient container, `docker run --rm` will remove the container after it stops.
|
If you want a transient container, `docker run --rm` will remove the container after it stops.
|
||||||
|
|
||||||
|
If you want to remove also the volumes associated with the container, the deletion of the container must include the -v switch like in `docker rm -v`.
|
||||||
|
|
||||||
If you want to poke around in an image, `docker run -t -i <myimage> <myshell>` to open a tty.
|
If you want to poke around in an image, `docker run -t -i <myimage> <myshell>` to open a tty.
|
||||||
|
|
||||||
If you want to map a directory on the host to a docker container, `docker run -v $HOSTDIR:$DOCKERDIR`. Also see [Volumes](https://github.com/wsargent/docker-cheat-sheet/#volumes).
|
If you want to map a directory on the host to a docker container, `docker run -v $HOSTDIR:$DOCKERDIR`. Also see [Volumes](https://github.com/wsargent/docker-cheat-sheet/#volumes).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue