Docker CLI
docker create
Prepare a new container without starting its command. Use --name for an unused identifier and --pull=never for a reviewed preloaded image. Prints an ID. The new object can be started later. Example requires a reviewed preloaded image, confirmed lab context and an unused name; remove only the created lab object after use.
Formal Syntax & Structure
docker syntaxdocker
docker create [OPTIONS] IMAGE [COMMAND] [ARG...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| IMAGE | string | Approved local image reference. |
| COMMAND | string | Override the default command when applicable. |
Return Value
ID
Full ID of the created container.
Working Example
Example Snippetdocker
docker create --pull=never --network none --name bm02-ref busybox:1.37 echo hello