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

NameTypeDescription
IMAGEimage referenceImage from which to create a container.
--rmflagRemove the container and associated anonymous volumes after exit.
--namestringAssign a container name.
--pullstringPull policy; never uses only an image already available to the engine.
--networkstringNetwork 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
Docker Reference