mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 11:06:00 +02:00
docker-run: add page (#4054)
This commit is contained in:
parent
22f186ac66
commit
35f90e5f59
1 changed files with 28 additions and 0 deletions
28
pages/common/docker-run.md
Normal file
28
pages/common/docker-run.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# docker run
|
||||
|
||||
> Run a command in a new Docker container.
|
||||
> More information: <https://docs.docker.com/engine/reference/commandline/run/>.
|
||||
|
||||
- Run command in a new container from a tagged image:
|
||||
|
||||
`docker run {{image:tag}} {{command}}`
|
||||
|
||||
- Run command in a new container in background and display its ID:
|
||||
|
||||
`docker run -d {{image}} {{command}}`
|
||||
|
||||
- Run command in a one-off container in interactive mode and pseudo-TTY:
|
||||
|
||||
`docker run --rm -it {{image}} {{command}}`
|
||||
|
||||
- Run command in a new container with passed environment variables:
|
||||
|
||||
`docker run -e '{{variable}}={{value}}' -e {{variable}} {{image}} {{command}}`
|
||||
|
||||
- Run command in a new container with bind mounted volumes:
|
||||
|
||||
`docker run -v {{path/to/host_path}}:{{path/to/container_path}} {{image}} {{command}}`
|
||||
|
||||
- Run command in a new container with published ports:
|
||||
|
||||
`docker run -p {{host_port}}:{{container_port}} {{image}} {{command}}`
|
Loading…
Add table
Reference in a new issue