docker-run

Run a command in a new Docker container.

TLDR

Run command in a new container from a tagged image

>_ docker run [image:tag] [command]
copy

Run command in a new container in background and display its ID

>_ docker run -d [image] [command]
copy

Run command in a one-off container in interactive mode and pseudo-TTY

>_ docker run --rm -it [image] [command]
copy

Run command in a new container with passed environment variables

>_ docker run -e '[variable]=[value]' -e [variable] [image] [command]
copy

Run command in a new container with bind mounted volumes

>_ docker run -v [path/to/host_path]:[path/to/container_path] [image] [command]
copy

Run command in a new container with published ports

>_ docker run -p [host_port]:[container_port] [image] [command]
copy

Copied to clipboard
free 100$ digital ocean credit