What does -p 8080:80 do?
docker run -d -p 8080:80 nginx
- Maps host port 8080 to container port 80
- Maps container port 8080 to host port 80
- Limits the container to 80 MB of memory
- Opens port 8080 in the host firewall
The format is host:container, and -d runs it detached.
Play DevOps ▸