Run a container with a published port
Starts the container in the background and forwards the host port to the container port.
docker run -d -p 8080:80 nginxEdit the highlighted values, then copy. They are inserted as typed, without shell escaping.
Report an issue (opens in a new tab) wrong command, wrong danger level, typo… (on GitHub)
Adapted from tldr-pages (common/docker-container-run.md), licensed under CC BY 4.0.