Docker CLI
docker run
Create and start a new container. --rm removes it and associated anonymous volumes after exit. Example requires a reviewed preloaded image on an approved disposable lab engine; --pull=never prevents implicit pulls and --network none disables external container networking.
Formal Syntax & Structure
docker syntaxdocker
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| IMAGE | image reference | Image from which to create a container. |
| --rm | flag | Remove the container and associated anonymous volumes after exit. |
| --name | string | Assign a container name. |
| --pull | string | Pull policy; never uses only an image already available to the engine. |
| --network | string | Network mode; none gives the container no external network interface. |
Return Value
CLI output
Program output or a detached container ID; failures may return a nonzero status.
Working Example
Example Snippetdocker
docker run --rm --pull=never --network none hello-world:latest