Docker

docker run

CautionRun a container

docker run -d -p 80:80 <image>

Starts a container from an image; -d detached, -p ports, -v volumes.

Examples

  • docker run -d -p 8080:80 --name web nginxRun nginx on 8080

Syntax

docker run [-d] [-it] [-p host:cont] [-v vol:path] [--name n] <image>

Before you run it

Mind exposed ports and mounts.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store