TOOL » VIRTUAL_ENVIRONMENT » DOCKER

Run

Usage

shell
docker run OPTIONS IMAGE COMMAND
OptionDescription
-d --detachRun container in background (detach).
-e --envSet environment variables.
-p --publishPublish a container's port(s) to the host in format HOST:CONT.
-i --interactiveKeep STDIN open even if not attached.
-t --ttyAllocate a pseudo-TTY.
-u --userUsername or UID.
-v --volumeBind mount a volume in format HOSTDIR:CONTDIR.
-w --workdirWorking directory inside the container.
--nameAssign a name to the container.
--mountAttach a filesystem mount to the container.
--rmAutomatically remove the container when it exits.

Resource constraint options:

OptionDescription
-m --memoryMemory limit. Followed by a suffix of b k m g. Ex: 1g for 1GB.
--cpusCPU resources a container can use. Ex: 1 for 1 CPU.

Mount syntax

SyntaxInfo
source=VOLNAME,target=CONTDIRMount a volume
type=bind,source=HOSTDIR,target=CONTDIRBind mount a volume