docker-run: use long options for examples (#8262)

This commit is contained in:
Muhammad Falak R Wani
2022-07-28 18:33:27 +05:30
committed by GitHub
parent 4a9b06e3a9
commit b7c8b55849
4 changed files with 20 additions and 20 deletions

View File

@@ -9,23 +9,23 @@
- Run command in a new container in background and display its ID:
`docker run -d {{image}} {{command}}`
`docker run --detach {{image}} {{command}}`
- Run command in a one-off container in interactive mode and pseudo-TTY:
`docker run --rm -it {{image}} {{command}}`
`docker run --rm --interactive --tty {{image}} {{command}}`
- Run command in a new container with passed environment variables:
`docker run -e '{{variable}}={{value}}' -e {{variable}} {{image}} {{command}}`
`docker run --env '{{variable}}={{value}}' --env {{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}}`
`docker run --volume {{/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}}`
`docker run --publish {{host_port}}:{{container_port}} {{image}} {{command}}`
- Run command in a new container overwriting the entrypoint of the image: