www.LinuxHowtos.org





DOCKER

Section: Docker User Manuals (1)
Updated: Jun 2025
Index Return to Main Contents

 

NAME

docke-containe-run- Create and run a new container from an image

 

SYNOPSIS

docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]

 

DESCRIPTION

Alias for docker run.

 

OPTIONS

-ad-host=         Add a custom hos-t-IP mapping (host:ip)

-annotation=map[]         Add an annotation to the container (passed through to the OCI runtime)

-a, -attach=         Attach to STDIN, STDOUT or STDERR

-blki-weight=0         Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)

-blki-weigh-device=[]         Block IO weight (relative device weight)

-ca-add=         Add Linux capabilities

-ca-drop=         Drop Linux capabilities

-cgrou-parent=""         Optional parent cgroup for the container

-cgroupns=""         Cgroup namespace to use (host|private)
'host': Run the container in the Docker host's cgroup namespace 'private': Run the container in its own private cgroup namespace '': Use the cgroup namespace as configured by the
           defaul-cgroupn-mode option on the daemon (default)

-cidfile=""         Write the container ID to the file

-cp-count=0         CPU count (Windows only)

-cp-percent=0         CPU percent (Windows only)

-cp-period=0         Limit CPU CFS (Completely Fair Scheduler) period

-cp-quota=0         Limit CPU CFS (Completely Fair Scheduler) quota

-cp-r-period=0         Limit CPU rea-time period in microseconds

-cp-r-runtime=0         Limit CPU rea-time runtime in microseconds

-c, -cp-shares=0         CPU shares (relative weight)

-cpus=         Number of CPUs

-cpuse-cpus=""         CPUs in which to allow execution (-3, 0,1)

-cpuse-mems=""         MEMs in which to allow execution (-3, 0,1)

-d, -detach[=false]         Run container in background and print container ID

-detac-keys=""         Override the key sequence for detaching a container

-device=         Add a host device to the container

-devic-cgrou-rule=         Add a rule to the cgroup allowed devices list

-devic-rea-bps=[]         Limit read rate (bytes per second) from a device

-devic-rea-iops=[]         Limit read rate (IO per second) from a device

-devic-writ-bps=[]         Limit write rate (bytes per second) to a device

-devic-writ-iops=[]         Limit write rate (IO per second) to a device

-disabl-conten-trust[=true]         Skip image verification

-dns=         Set custom DNS servers

-dn-option=         Set DNS options

-dn-search=         Set custom DNS search domains

-domainname=""         Container NIS domain name

-entrypoint=""         Overwrite the default ENTRYPOINT of the image

-e, -env=         Set environment variables

-en-file=         Read in a file of environment variables

-expose=         Expose a port or a range of ports

-gpus=         GPU devices to add to the container ('all' to pass all GPUs)

-grou-add=         Add additional groups to join

-healt-cmd=""         Command to run to check health

-healt-interval=0s         Time between running the check (ms|s|m|h) (default 0s)

-healt-retries=0         Consecutive failures needed to report unhealthy

-healt-star-interval=0s         Time between running the check during the start period (ms|s|m|h) (default 0s)

-healt-star-period=0s         Start period for the container to initialize before starting healt-retries countdown (ms|s|m|h) (default 0s)

-healt-timeout=0s         Maximum time to allow one check to run (ms|s|m|h) (default 0s)

-help[=false]         Print usage

-h, -hostname=""         Container host name

-init[=false]         Run an init inside the container that forwards signals and reaps processes

-i, -interactive[=false]         Keep STDIN open even if not attached

-i-maxbandwidth=0         Maximum IO bandwidth limit for the system drive (Windows only)

-i-maxiops=0         Maximum IOps limit for the system drive (Windows only)

-ip=""         IPv4 address (e.g., 172.30.100.104)

-ip6=""         IPv6 address (e.g., 2001:db8::33)

-ipc=""         IPC mode to use

-isolation=""         Container isolation technology

-kerne-memory=0         Kernel memory limit

-l, -label=         Set meta data on a container

-labe-file=         Read in a line delimited file of labels

-link=         Add link to another container

-lin-loca-ip=         Container IPv4/IPv6 lin-local addresses

-lo-driver=""         Logging driver for the container

-lo-opt=         Log driver options

-ma-address=""         Container MAC address (e.g., 92:d0:c6:0a:29:33)

-m, -memory=0         Memory limit

-memor-reservation=0         Memory soft limit

-memor-swap=0         Swap limit equal to memory plus swap: -1' to enable unlimited swap

-memor-swappiness-1         Tune container memory swappiness (0 to 100)

-mount=         Attach a filesystem mount to the container

-name=""         Assign a name to the container

-network=         Connect a container to a network

-networ-alias=         Add networ-scoped alias for the container

-n-healthcheck[=false]         Disable any containe-specified HEALTHCHECK

-oo-kil-disable[=false]         Disable OOM Killer

-oo-scor-adj=0         Tune host's OOM preferences -1000 to 1000)

-pid=""         PID namespace to use

-pid-limit=0         Tune container pids limit (set-1 for unlimited)

-platform=""         Set platform if server is mult-platform capable

-privileged[=false]         Give extended privileges to this container

-p, -publish=         Publish a container's port(s) to the host

-P, -publis-all[=false]         Publish all exposed ports to random ports

-pull="missing"         Pull image before running ("always", "missing", "never")

-q, -quiet[=false]         Suppress the pull output

-rea-only[=false]         Mount the container's root filesystem as read only

-restart="no"         Restart policy to apply when a container exits

-rm[=false]         Automatically remove the container and its associated anonymous volumes when it exits

-runtime=""         Runtime to use for this container

-securit-opt=         Security Options

-sh-size=0         Size of /dev/shm

-si-proxy[=true]         Proxy received signals to the process

-sto-signal=""         Signal to stop the container

-sto-timeout=0         Timeout (in seconds) to stop a container

-storag-opt=         Storage driver options for the container

-sysctl=map[]         Sysctl options

-tmpfs=         Mount a tmpfs directory

-t, -tty[=false]         Allocate a pseud-TTY

-ulimit=[]         Ulimit options

-us-ap-socket[=false]         Bind mount Docker API socket and required auth

-u, -user=""         Username or UID (format: [:])

-userns=""         User namespace to use

-uts=""         UTS namespace to use

-v, -volume=         Bind mount a volume

-volum-driver=""         Optional volume driver for the container

-volume-from=         Mount volumes from the specified container(s)

-w, -workdir=""         Working directory inside the container

 

SEE ALSO

docke-container(1)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO