docker_run
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| docker_run [2015/10/06 13:05] – created luke7858 | docker_run [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| |--rm | Remove the container after the command/ | |--rm | Remove the container after the command/ | ||
| | -v | adds a volume to the container | | | -v | adds a volume to the container | | ||
| + | | -d | tells Docker to run the container in the background | ||
| + | | -P | automatically map any network port inside the container to a random high port within an ephemeral port range on your Docker host | | ||
| + | | -p | e.g. -p 80:5000 binds the container to a specific port. This would map port 5000 inside our container to port 80 on our local host | | ||
| + | | -h | ||
| + | networking source http:// | ||
| + | == Example Run with Mounted Volume == | ||
| <sxh bash> | <sxh bash> | ||
| + | docker run -it -v / | ||
| </ | </ | ||
| + | === Example Run MountedVolume& | ||
| <sxh bash> | <sxh bash> | ||
| + | docker run -it -p 80:8081 -v / | ||
| </ | </ | ||
docker_run.1444136701.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
