Man page - docker-run(1)
Packages contains this manual
- docker-port(1)
- docker-manifest(1)
- docker-image-rm(1)
- docker-container-attach(1)
- docker-network-prune(1)
- docker-login(1)
- docker-system-df(1)
- docker-container-prune(1)
- docker-container-logs(1)
- docker-unpause(1)
- docker-trust(1)
- docker-images(1)
- docker-container-diff(1)
- docker-volume-update(1)
- docker-plugin-ls(1)
- docker-plugin-install(1)
- docker-context-use(1)
- docker-stack-rm(1)
- docker-swarm-init(1)
- docker-container-cp(1)
- docker-context-update(1)
- docker-builder-build(1)
- docker-rm(1)
- docker-swarm(1)
- docker-plugin-inspect(1)
- docker-stack-ls(1)
- docker-context-import(1)
- docker-builder(1)
- docker-container-stop(1)
- docker-container-restart(1)
- docker-stack-config(1)
- docker-network-ls(1)
- docker-container-create(1)
- docker-container-ls(1)
- docker-swarm-unlock-key(1)
- docker-config-inspect(1)
- docker-secret-create(1)
- docker-node-ls(1)
- docker-pause(1)
- docker-volume-inspect(1)
- docker-logs(1)
- docker-container-rm(1)
- docker-config-ls(1)
- docker-trust-sign(1)
- docker-swarm-join-token(1)
- docker-info(1)
- docker-image(1)
- docker-image-build(1)
- docker-run(1)
- docker-node-rm(1)
- docker-stack-services(1)
- docker-stack-ps(1)
- docker-container-kill(1)
- docker-container-start(1)
- docker-checkpoint-ls(1)
- docker-container-pause(1)
- docker-service-ls(1)
- docker-context-create(1)
- docker-system-prune(1)
- docker-service-logs(1)
- docker-plugin-set(1)
- docker-rename(1)
- docker-container-exec(1)
- docker-trust-signer-remove(1)
- docker-stack(1)
- docker-image-prune(1)
- docker-trust-key-generate(1)
- docker-node-inspect(1)
- docker-restart(1)
- docker-context-export(1)
- docker-top(1)
- docker-context(1)
- docker-swarm-join(1)
- docker-load(1)
- docker-service-inspect(1)
- docker-service-create(1)
- docker-swarm-ca(1)
- docker-service-scale(1)
- docker-network-rm(1)
- docker-wait(1)
- docker-manifest-create(1)
- docker-manifest-rm(1)
- docker-build(1)
- docker-volume-ls(1)
- docker-kill(1)
- docker-checkpoint-rm(1)
- docker-pull(1)
- docker-node-demote(1)
- docker-swarm-leave(1)
- docker-context-show(1)
- docker-image-save(1)
- docker-plugin(1)
- docker-context-inspect(1)
- docker-image-push(1)
- docker-builder-prune(1)
- docker-service(1)
- docker-secret-rm(1)
- docker-stats(1)
- docker-history(1)
- docker-export(1)
- docker-trust-revoke(1)
- docker-volume-prune(1)
- docker-service-ps(1)
- docker-rmi(1)
- docker-import(1)
- docker-swarm-unlock(1)
- docker-exec(1)
- docker(1)
- docker-system(1)
- docker-container(1)
- docker-stop(1)
- docker-node-ps(1)
- docker-image-load(1)
- docker-trust-signer(1)
- docker-container-port(1)
- docker-cp(1)
- docker-bake(1)
- docker-volume(1)
- docker-network-create(1)
- docker-container-run(1)
- docker-tag(1)
- docker-context-rm(1)
- docker-update(1)
- docker-context-ls(1)
- docker-service-rollback(1)
- docker-search(1)
- docker-image-pull(1)
- docker-config(1)
- docker-attach(1)
- docker-plugin-upgrade(1)
- docker-network(1)
- docker-config-create(1)
- docker-diff(1)
- docker-plugin-create(1)
- docker-system-events(1)
- docker-swarm-update(1)
- docker-events(1)
- docker-secret-inspect(1)
- docker-container-unpause(1)
- docker-container-commit(1)
- docker-plugin-disable(1)
- docker-secret-ls(1)
- docker-checkpoint(1)
- docker-start(1)
- docker-network-connect(1)
- docker-trust-signer-add(1)
- docker-container-top(1)
- docker-manifest-annotate(1)
- docker-commit(1)
- docker-config-json(5)
- docker-plugin-push(1)
- docker-network-inspect(1)
- docker-image-ls(1)
- docker-service-rm(1)
- docker-node(1)
- docker-volume-create(1)
- docker-image-history(1)
- docker-push(1)
- docker-plugin-enable(1)
- docker-container-stats(1)
- docker-secret(1)
- docker-ps(1)
- docker-image-inspect(1)
- docker-config-rm(1)
- docker-container-rename(1)
- docker-plugin-rm(1)
- docker-trust-inspect(1)
- docker-image-import(1)
- docker-service-update(1)
- docker-create(1)
- docker-container-update(1)
- docker-stack-deploy(1)
- docker-node-promote(1)
- docker-container-inspect(1)
- docker-node-update(1)
- docker-manifest-inspect(1)
- docker-checkpoint-create(1)
- docker-container-wait(1)
- docker-save(1)
- docker-trust-key-load(1)
- docker-system-info(1)
- docker-container-export(1)
- docker-network-disconnect(1)
- docker-image-tag(1)
- docker-inspect(1)
- docker-trust-key(1)
- docker-volume-rm(1)
- docker-manifest-push(1)
- docker-version(1)
- docker-logout(1)
- docker-port(1)
- docker-manifest(1)
- dockerd(8)
- docker-image-rm(1)
- docker-container-attach(1)
- docker-network-prune(1)
- docker-login(1)
- docker-system-df(1)
- docker-container-prune(1)
- docker-container-logs(1)
- docker-unpause(1)
- docker-trust(1)
- docker-images(1)
- docker-container-diff(1)
- docker-volume-update(1)
- docker-plugin-ls(1)
- docker-plugin-install(1)
- docker-context-use(1)
- docker-stack-rm(1)
- docker-swarm-init(1)
- docker-container-cp(1)
- docker-context-update(1)
- docker-builder-build(1)
- docker-rm(1)
- docker-swarm(1)
- docker-plugin-inspect(1)
- docker-stack-ls(1)
- docker-context-import(1)
- docker-builder(1)
- docker-container-stop(1)
- docker-container-restart(1)
- docker-stack-config(1)
- docker-network-ls(1)
- docker-container-create(1)
- docker-container-ls(1)
- docker-swarm-unlock-key(1)
- docker-config-inspect(1)
- docker-secret-create(1)
- docker-node-ls(1)
- docker-pause(1)
- docker-volume-inspect(1)
- docker-logs(1)
- docker-container-rm(1)
- docker-config-ls(1)
- docker-trust-sign(1)
- docker-swarm-join-token(1)
- docker-info(1)
- docker-image(1)
- docker-image-build(1)
- docker-run(1)
- docker-node-rm(1)
- docker-stack-services(1)
- docker-stack-ps(1)
- docker-container-kill(1)
- docker-container-start(1)
- docker-checkpoint-ls(1)
- docker-container-pause(1)
- docker-service-ls(1)
- docker-context-create(1)
- docker-system-prune(1)
- docker-service-logs(1)
- docker-plugin-set(1)
- docker-rename(1)
- docker-container-exec(1)
- docker-trust-signer-remove(1)
- docker-stack(1)
- docker-image-prune(1)
- docker-trust-key-generate(1)
- docker-node-inspect(1)
- docker-restart(1)
- docker-context-export(1)
- docker-top(1)
- docker-context(1)
- docker-swarm-join(1)
- docker-load(1)
- docker-service-inspect(1)
- docker-service-create(1)
- docker-swarm-ca(1)
- docker-service-scale(1)
- docker-network-rm(1)
- docker-wait(1)
- docker-manifest-create(1)
- docker-manifest-rm(1)
- docker-build(1)
- docker-volume-ls(1)
- docker-kill(1)
- docker-checkpoint-rm(1)
- docker-pull(1)
- docker-node-demote(1)
- docker-swarm-leave(1)
- docker-context-show(1)
- docker-image-save(1)
- docker-plugin(1)
- docker-context-inspect(1)
- docker-image-push(1)
- docker-builder-prune(1)
- docker-service(1)
- docker-secret-rm(1)
- docker-stats(1)
- docker-history(1)
- docker-export(1)
- docker-trust-revoke(1)
- docker-volume-prune(1)
- docker-service-ps(1)
- docker-rmi(1)
- docker-import(1)
- docker-swarm-unlock(1)
- docker-exec(1)
- docker(1)
- docker-system(1)
- docker-container(1)
- docker-stop(1)
- docker-node-ps(1)
- docker-image-load(1)
- docker-trust-signer(1)
- docker-container-port(1)
- docker-cp(1)
- docker-volume(1)
- docker-network-create(1)
- docker-container-run(1)
- docker-tag(1)
- docker-context-rm(1)
- docker-update(1)
- docker-context-ls(1)
- docker-service-rollback(1)
- docker-search(1)
- docker-image-pull(1)
- docker-config(1)
- docker-attach(1)
- docker-plugin-upgrade(1)
- docker-network(1)
- docker-config-create(1)
- docker-diff(1)
- docker-plugin-create(1)
- docker-system-events(1)
- docker-swarm-update(1)
- docker-events(1)
- docker-secret-inspect(1)
- docker-container-unpause(1)
- docker-container-commit(1)
- docker-plugin-disable(1)
- docker-secret-ls(1)
- docker-checkpoint(1)
- docker-start(1)
- docker-network-connect(1)
- docker-trust-signer-add(1)
- docker-container-top(1)
- docker-manifest-annotate(1)
- docker-commit(1)
- docker-config-json(5)
- docker-plugin-push(1)
- docker-network-inspect(1)
- docker-image-ls(1)
- docker-service-rm(1)
- docker-node(1)
- docker-volume-create(1)
- docker-image-history(1)
- docker-push(1)
- docker-plugin-enable(1)
- docker-container-stats(1)
- docker-secret(1)
- docker-ps(1)
- docker-image-inspect(1)
- docker-config-rm(1)
- docker-container-rename(1)
- docker-plugin-rm(1)
- docker-trust-inspect(1)
- docker-image-import(1)
- docker-service-update(1)
- docker-create(1)
- docker-container-update(1)
- docker-stack-deploy(1)
- docker-node-promote(1)
- docker-container-inspect(1)
- docker-node-update(1)
- docker-manifest-inspect(1)
- docker-checkpoint-create(1)
- docker-container-wait(1)
- docker-save(1)
- docker-trust-key-load(1)
- docker-system-info(1)
- docker-container-export(1)
- docker-network-disconnect(1)
- docker-image-tag(1)
- docker-inspect(1)
- docker-trust-key(1)
- docker-volume-rm(1)
- docker-manifest-push(1)
- docker-version(1)
- docker-logout(1)
- docker-port(1)
- docker-machine-os-apply(1)
- docker-manifest(1)
- docker-image-rm(1)
- docker-container-attach(1)
- dockerignore(5)
- docker-network-prune(1)
- docker-login(1)
- docker-system-df(1)
- docker-container-prune(1)
- docker-container-logs(1)
- docker-unpause(1)
- docker-images(1)
- docker-container-diff(1)
- docker-untag(1)
- docker-generate-spec(1)
- docker-pod-stop(1)
- docker-pod-ps(1)
- docker-system-connection-remove(1)
- docker-system-reset(1)
- docker-machine-ls(1)
- docker-container-cp(1)
- docker-rm(1)
- docker-image-search(1)
- docker-network-update(1)
- docker-container-stop(1)
- docker-container-restart(1)
- docker-network-ls(1)
- docker-container-create(1)
- docker-pod-create(1)
- docker-container-ls(1)
- docker-image-sign(1)
- docker-system-connection-list(1)
- docker-secret-create(1)
- docker-pause(1)
- docker-volume-inspect(1)
- docker-logs(1)
- docker-container-rm(1)
- docker-healthcheck(1)
- docker-system-service(1)
- docker-machine-reset(1)
- docker-system-migrate(1)
- docker-info(1)
- docker-image(1)
- docker-image-build(1)
- docker-pod-start(1)
- docker-run(1)
- docker-kube-play(1)
- docker-machine-inspect(1)
- docker-container-kill(1)
- docker-container-start(1)
- docker-pod-pause(1)
- docker-pod(1)
- docker-container-pause(1)
- docker-artifact-pull(1)
- docker-init(1)
- docker-system-prune(1)
- docker-farm-update(1)
- docker-container-ps(1)
- docker-rename(1)
- docker-container-exec(1)
- docker-play-kube(1)
- docker-volume-export(1)
- docker-image-prune(1)
- docker-completion(1)
- docker-healthcheck-run(1)
- docker-restart(1)
- docker-top(1)
- docker-pod-clone(1)
- docker-kube(1)
- docker-remote(1)
- docker-load(1)
- docker-pod-logs(1)
- docker-network-rm(1)
- docker-wait(1)
- docker-image-list(1)
- docker-kube-generate(1)
- docker-manifest-rm(1)
- docker-build(1)
- docker-umount(1)
- docker-manifest-create(1)
- docker-volume-ls(1)
- docker-artifact-ls(1)
- docker-kill(1)
- docker-generate(1)
- docker-pull(1)
- docker-volume-unmount(1)
- docker-machine(1)
- docker-artifact-rm(1)
- docker-image-save(1)
- docker-image-push(1)
- docker-image-diff(1)
- docker-container-runlabel(1)
- docker-secret-rm(1)
- docker-stats(1)
- docker-history(1)
- docker-export(1)
- docker-volume-prune(1)
- docker-image-unmount(1)
- docker-kube-apply(1)
- docker-image-umount(1)
- docker-rmi(1)
- docker-import(1)
- docker-machine-os(1)
- docker-exec(1)
- docker-artifact-push(1)
- docker-farm(1)
- docker-farm-build(1)
- docker-volume-exists(1)
- docker(1)
- docker-system(1)
- docker-container(1)
- docker-pod-stats(1)
- docker-stop(1)
- docker-manifest-add(1)
- docker-image-load(1)
- docker-container-exists(1)
- docker-kube-down(1)
- docker-container-port(1)
- docker-container-clone(1)
- docker-cp(1)
- docker-volume(1)
- docker-network-create(1)
- docker-container-run(1)
- docker-farm-remove(1)
- docker-tag(1)
- docker-manifest-exists(1)
- docker-machine-start(1)
- docker-image-trust(1)
- docker-update(1)
- docker-pod-exists(1)
- docker-pod-prune(1)
- docker-unmount(1)
- docker-auto-update(1)
- docker-system-connection-default(1)
- docker-search(1)
- docker-image-pull(1)
- docker-network(1)
- docker-attach(1)
- docker-pod-top(1)
- docker-system-connection-rename(1)
- docker-manifest-remove(1)
- docker-diff(1)
- docker-system-events(1)
- docker-image-scp(1)
- docker-network-reload(1)
- docker-unshare(1)
- docker-events(1)
- docker-secret-inspect(1)
- docker-container-unpause(1)
- docker-container-commit(1)
- docker-artifact(1)
- docker-system-connection(1)
- docker-secret-ls(1)
- docker-artifact-inspect(1)
- docker-start(1)
- docker-network-connect(1)
- docker-system-check(1)
- docker-container-mount(1)
- docker-machine-info(1)
- docker-container-top(1)
- docker-generate-kube(1)
- docker-system-renumber(1)
- docker-manifest-annotate(1)
- docker-artifact-add(1)
- docker-commit(1)
- docker-volume-import(1)
- docker-machine-ssh(1)
- docker-help(1)
- docker-network-inspect(1)
- docker-image-ls(1)
- docker-container-checkpoint(1)
- docker-farm-create(1)
- docker-volume-create(1)
- docker-image-history(1)
- docker-container-init(1)
- docker-container-restore(1)
- docker-pod-inspect(1)
- docker-push(1)
- docker-container-stats(1)
- docker-secret(1)
- docker-machine-stop(1)
- docker-system-connection-add(1)
- docker-image-untag(1)
- docker-ps(1)
- docker-image-inspect(1)
- docker-container-rename(1)
- docker-mount(1)
- docker-image-mount(1)
- docker-container-cleanup(1)
- docker-machine-rm(1)
- docker-pod-unpause(1)
- docker-image-import(1)
- docker-pod-kill(1)
- docker-create(1)
- docker-container-list(1)
- docker-container-update(1)
- docker-network-exists(1)
- docker-container-inspect(1)
- docker-volume-reload(1)
- docker-machine-set(1)
- dockerfile(5)
- docker-container-umount(1)
- docker-manifest-inspect(1)
- docker-machine-init(1)
- docker-image-tree(1)
- docker-container-wait(1)
- docker-farm-list(1)
- docker-save(1)
- docker-container-unmount(1)
- docker-system-info(1)
- docker-pod-rm(1)
- docker-container-export(1)
- docker-secret-exists(1)
- docker-pod-restart(1)
- docker-network-disconnect(1)
- docker-image-tag(1)
- docker-inspect(1)
- docker-machine-list(1)
- docker-image-exists(1)
- docker-volume-rm(1)
- docker-volume-mount(1)
- docker-manifest-push(1)
- docker-version(1)
- docker-logout(1)
- docker-generate-systemd(1)
apt-get install docker-ce-cli
apt-get install docker.io
apt-get install podman-docker
Manual
DOCKER
NAMESYNOPSIS
DESCRIPTION
OPTIONS
Exit Status
EXAMPLES
Running container in read-only mode
Exposing log messages from the container to the hostâs log
Attaching to one or more from STDIN, STDOUT, STDERR
Sharing IPC between containers
Linking Containers
Mapping Ports for External Usage
Creating and Mounting a Data Volume Container
Mounting External Volumes
Using alternative security labeling
Setting device weight
Specify isolation technology for container (--isolation)
Setting Namespaced Kernel Parameters (Sysctls)
HISTORY
NAME
docker-run - Create and run a new container from an image
SYNOPSIS
docker run [ -a | --attach [= [] ]] [ --add-host [= [] ]] [ --annotation [= [] ]] [ --blkio-weight [= [BLKIO-WEIGHT] ]] [ --blkio-weight-device [= [] ]] [ -c | --cpu-shares [= 0 ]] [ --cap-add [= [] ]] [ --cap-drop [= [] ]] [ --cgroupns [= [] ]] [ --cgroup-parent [= CGROUP-PATH ]] [ --cidfile [= CIDFILE ]] [ --cpu-count [= 0 ]] [ --cpu-percent [= 0 ]] [ --cpu-period [= 0 ]] [ --cpu-quota [= 0 ]] [ --cpu-rt-period [= 0 ]] [ --cpu-rt-runtime [= 0 ]] [ --cpus [= 0.0 ]] [ --cpuset-cpus [= CPUSET-CPUS ]] [ --cpuset-mems [= CPUSET-MEMS ]] [ -d | --detach ] [ --detach-keys [= [] ]] [ --device [= [] ]] [ --device-cgroup-rule [= [] ]] [ --device-read-bps [= [] ]] [ --device-read-iops [= [] ]] [ --device-write-bps [= [] ]] [ --device-write-iops [= [] ]] [ --dns [= [] ]] [ --dns-option [= [] ]] [ --dns-search [= [] ]] [ --domainname [= DOMAINNAME ]] [ -e | --env [= [] ]] [ --entrypoint [= ENTRYPOINT ]] [ --env-file [= [] ]] [ --expose [= [] ]] [ --group-add [= [] ]] [ -h | --hostname [= HOSTNAME ]] [ --help ] [ --init ] [ -i | --interactive ] [ --ip [= IPv4-ADDRESS ]] [ --ip6 [= IPv6-ADDRESS ]] [ --ipc [= IPC ]] [ --isolation [= default ]] [ --kernel-memory [= KERNEL-MEMORY ]] [ -l | --label [= [] ]] [ --label-file [= [] ]] [ --link [= [] ]] [ --link-local-ip [= [] ]] [ --log-driver [= [] ]] [ --log-opt [= [] ]] [ -m | --memory [= MEMORY ]] [ --mac-address [= MAC-ADDRESS ]] [ --memory-reservation [= MEMORY-RESERVATION ]] [ --memory-swap [= LIMIT ]] [ --memory-swappiness [= MEMORY-SWAPPINESS ]] [ --mount [= [MOUNT] ]] [ --name [= NAME ]] [ --network-alias [= [] ]] [ --network [= "bridge" ]] [ --oom-kill-disable ] [ --oom-score-adj [= 0 ]] [ -P | --publish-all ] [ -p | --publish [= [] ]] [ --pid [= [PID] ]] [ --userns [= [] ]] [ --pids-limit [= PIDS_LIMIT ]] [ --privileged ] [ --read-only ] [ --restart [= RESTART ]] [ --rm ] [ --security-opt [= [] ]] [ --storage-opt [= [] ]] [ --stop-signal [= SIGNAL ]] [ --stop-timeout [= TIMEOUT ]] [ --shm-size [= [] ]] [ --sig-proxy [= true ]] [ --sysctl [= [] ]] [ -t | --tty ] [ --tmpfs [= [CONTAINER-DIR[:OPTIONS] ]] [ -u | --user [= USER ]] [ --ulimit [= [] ]] [ --uts [= [] ]] [ -v | --volume [= [[HOST-DIR:]CONTAINER-DIR[:OPTIONS]] ]] [ --volume-driver [= DRIVER ]] [ --volumes-from [= [] ]] [ -w | --workdir [= WORKDIR ]] IMAGE [COMMAND] [ARG...]
DESCRIPTION
Run a process in a new container. docker run starts a process with its own file system, its own networking, and its own isolated process tree. The IMAGE which starts the process may define defaults related to the process that will be run in the container, the networking to expose, and more, but docker run gives final control to the operator or administrator who starts the container from the image. For that reason docker run has more options than any other Docker command.
If the IMAGE is not already loaded then docker run will pull the IMAGE, and all image dependencies, from the repository in the same way running docker pull IMAGE, before it starts the container from that image.
OPTIONS
-a
,
--attach
=[]
Attach to STDIN, STDOUT or STDERR.
In foreground mode (the default when -d is not specified), docker run can start the process in the container and attach the console to the processâs standard input, output, and standard error. It can even pretend to be a TTY (this is what most commandline executables expect) and pass along signals. The -a option can be set for each of stdin, stdout, and stderr.
--add-host
=[]
Add a custom host-to-IP mapping (host=ip, or host:ip)
Add a line to
/etc/hosts. The format is hostname=ip, or hostname:ip.
The
--add-host
option can be set multiple times.
--annotation
=[]
Add an annotation to the container (passed through to the
OCI runtime).
The annotations are provided to the OCI runtime.
--blkio-weight
=
0
Block IO weight (relative weight) accepts a weight value
between 10 and 1000.
--blkio-weight-device
=[]
Block IO weight (relative device weight, format:
DEVICE_NAME:WEIGHT
).
-c
,
--cpu-shares
=
0
CPU shares (relative weight)
By default, all containers get the same proportion of CPU cycles. This proportion can be modified by changing the containerâs CPU share weighting relative to the weighting of all other running containers.
To modify the proportion from the default of 1024, use the -c or --cpu-shares flag to set the weighting to 2 or higher.
The proportion will only apply when CPU-intensive processes are running. When tasks in one container are idle, other containers can use the left-over CPU time. The actual amount of CPU time will vary depending on the number of containers running on the system.
For example, consider three containers, one has a cpu-share of 1024 and two others have a cpu-share setting of 512. When processes in all three containers attempt to use 100% of CPU, the first container would receive 50% of the total CPU time. If you add a fourth container with a cpu-share of 1024, the first container only gets 33% of the CPU. The remaining containers receive 16.5%, 16.5% and 33% of the CPU.
On a multi-core system, the shares of CPU time are distributed over all CPU cores. Even if a container is limited to less than 100% of CPU time, it can use 100% of each individual CPU core.
For example, consider a system with more than three cores. If you start one container {C0} with -c=512 running one process, and another container {C1} with -c=1024 running two processes, this can result in the following division of CPU shares:
|
PID container |
CPU |
CPU share |
||||
|
100 {C0} |
0 |
100% of CPU0 |
||||
|
101 {C1} |
1 |
100% of CPU1 |
||||
|
102 {C1} |
2 |
100% of CPU2 |
--cap-add
=[]
Add Linux capabilities
--cap-drop
=[]
Drop Linux capabilities
--cgroupns
=""
Set the cgroup namespace mode for the container.
host
: run the container in the hostâs cgroup
namespace
private
: run the container in its own private cgroup
namespace
""
: (unset) use the daemonâs default
configuration (
host
on cgroup v1,
private
on
cgroup v2)
--cgroup-parent
=""
Path to cgroups under which the cgroup for the container
will be created. If the path is not absolute, the path is
considered to be relative to the cgroups path of the init
process. Cgroups will be created if they do not already
exist.
--cidfile
=""
Write the container ID to the file
--cpu-count
=
0
Limit the number of CPUs available for execution by the
container.
On Windows Server containers, this is approximated as a percentage of total CPU usage.
On Windows Server containers, the processor resource controls are mutually exclusive, the order of precedence is CPUCount first, then CPUShares, and CPUPercent last.
--cpu-percent
=
0
Limit the percentage of CPU available for execution by a
container running on a Windows daemon.
On Windows Server containers, the processor resource controls are mutually exclusive, the order of precedence is CPUCount first, then CPUShares, and CPUPercent last.
--cpu-period
=
0
Limit the CPU CFS (Completely Fair Scheduler) period
Limit the containerâs CPU usage. This flag tell the kernel to restrict the containerâs CPU usage to the period you specify.
--cpuset-cpus
=""
CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems
=""
Memory nodes (MEMs) in which to allow execution (0-3, 0,1).
Only effective on NUMA systems.
If you have four memory nodes on your system (0-3), use --cpuset-mems=0,1 then processes in your Docker container will only use memory from the first two memory nodes.
--cpu-quota
=
0
Limit the CPU CFS (Completely Fair Scheduler) quota
Limit the containerâs CPU usage. By default, containers run with the full CPU resource. This flag tell the kernel to restrict the containerâs CPU usage to the quota you specify.
--cpu-rt-period
=0
Limit the CPU real-time period in microseconds
Limit the containerâs Real Time CPU usage. This flag tell the kernel to restrict the containerâs Real Time CPU usage to the period you specify.
--cpu-rt-runtime
=0
Limit the CPU real-time runtime in microseconds
Limit the
containers Real Time CPU usage. This flag tells the kernel
to limit the amount of time in a given CPU period Real Time
tasks may consume. Ex:
Period of 1,000,000us and Runtime of 950,000us means that
this container could consume 95% of available CPU and leave
the remaining 5% to normal priority tasks.
The sum of all runtimes across containers cannot exceed the amount allotted to the parent cgroup.
--cpus
=0.0
Number of CPUs. The default is
0.0
which means no
limit.
-d
,
--detach
=
true
|
false
Detached mode: run the container in the background and print
the new container ID. The default is
false
.
At any time you can run docker ps in the other shell to view a list of the running containers. You can reattach to a detached container with docker attach .
When attached in the tty mode, you can detach from the container (and leave it running) using a configurable key sequence. The default sequence is CTRL-p CTRL-q . You configure the key sequence using the --detach-keys option or a configuration file. See config-json(5) for documentation on using a configuration file.
--detach-keys
=
key
Override the key sequence for detaching a container;
key
is a single character from the [a-Z] range, or
ctrl
-
value
, where
value
is one of:
a-z
,
@
,
Ë
,
[
,
,
, or
_
.
--device
=
onhost
:
incontainer
[:
mode
]
Add a host device
onhost
to the container under the
incontainer
name. Optional
mode
parameter can
be used to specify device permissions, it is a combination
of
r
(for read),
w
(for write), and
m
(for
mknod
(2)).
For example, --device=/dev/sdc:/dev/xvdc:rwm will give a container all permissions for the host device /dev/sdc , seen as /dev/xvdc inside the container.
--device-cgroup-rule
="
type
major
:
minor mode
"
Add a rule to the cgroup allowed devices list. The rule is
expected to be in the format specified in the Linux kernel
documentation (Documentation/cgroup-v1/devices.txt):
-
type
:
a
(all),
c
(char), or
b
(block);
-
major
and
minor
: either a number, or
*
for all;
-
mode
: a composition of
r
(read),
w
(write), and
m
(
mknod
(2)).
Example: --device-cgroup-rule "c 1:3 mr" : allow for a character device idendified by 1:3 to be created and read.
--device-read-bps
=[]
Limit read rate from a device (e.g.
--device-read-bps=/dev/sda:1mb)
--device-read-iops
=[]
Limit read rate from a device (e.g.
--device-read-iops=/dev/sda:1000)
--device-write-bps
=[]
Limit write rate to a device (e.g.
--device-write-bps=/dev/sda:1mb)
--device-write-iops
=[]
Limit write rate to a device (e.g.
--device-write-iops=/dev/sda:1000)
--dns-search
=[]
Set custom DNS search domains (Use --dns-search=. if you
donât wish to set the search domain)
--dns-option
=[]
Set custom DNS options
--dns
=[]
Set custom DNS servers
This option can be used to override the DNS configuration passed to the container. Typically this is necessary when the host DNS configuration is invalid for the container (e.g., 127.0.0.1). When this is the case the --dns flags is necessary for every run.
--domainname
=""
Container NIS domain name
Sets the
containerâs NIS domain name (see also
setdomainname(2)
) that is
available inside the container.
-e
,
--env
=[]
Set environment variables
This option allows you to specify arbitrary environment variables that are available for the process that will be launched inside of the container.
--entrypoint
=""
Overwrite the default ENTRYPOINT of the image
This option allows you to overwrite the default entrypoint of the image that is set in the Dockerfile. The ENTRYPOINT of an image is similar to a COMMAND because it specifies what executable to run when the container starts, but it is (purposely) more difficult to override. The ENTRYPOINT gives a container its default nature or behavior, so that when you set an ENTRYPOINT you can run the container as if it were that binary, complete with default options, and you can pass in more options via the COMMAND. But, sometimes an operator may want to run something else inside the container, so you can override the default ENTRYPOINT at runtime by using a --entrypoint and a string to specify the new ENTRYPOINT.
--env-file
=[]
Read in a line delimited file of environment variables
--expose
=[]
Expose a port, or a range of ports (e.g. --expose=3300-3310)
informs Docker that the container listens on the specified
network ports at runtime. Docker uses this information to
interconnect containers using links and to set up port
redirection on the host system.
--group-add
=[]
Add additional groups to run as
-h
,
--hostname
=""
Container host name
Sets the container host name that is available inside the container.
--help
Print usage statement
--init
Run an init inside the container that forwards signals and
reaps processes
-i
,
--interactive
=
true
|
false
Keep STDIN open even if not attached. The default is
false
.
When set to true, keep stdin open even if not attached.
--ip
=""
Sets the containerâs interface IPv4 address (e.g.,
172.23.0.9)
It can only be used in conjunction with --network for user-defined networks
--ip6
=""
Sets the containerâs interface IPv6 address (e.g.,
2001:db8::1b99)
It can only be used in conjunction with --network for user-defined networks
--ipc
=""
Sets the IPC mode for the container. The following values
are accepted: