docker_run
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| docker_run [2015/10/06 14:21] – luke7858 | docker_run [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| | -v | adds a volume to the container | | | -v | adds a volume to the container | | ||
| | -d | tells Docker to run the container in the background | | -d | tells Docker to run the container in the background | ||
| - | | -P | automatically map any network port inside | + | | -P | automatically map any network port inside |
| | -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 | | | -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 | | -h | ||
| + | networking source http:// | ||
| + | == Example Run with Mounted Volume == | ||
| <sxh bash> | <sxh bash> | ||
| docker run -it -v / | docker run -it -v / | ||
| </ | </ | ||
| + | === Example Run MountedVolume& | ||
| <sxh bash> | <sxh bash> | ||
| + | docker run -it -p 80:8081 -v / | ||
| </ | </ | ||
docker_run.1444141311.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
