docker run

Practice docker run from memory. -d = detached (background), -p host:container port mapping, --name gives it a stable name. Always name containers for ea

Run nginx in detached mode and publish host port 8080 to container port 80.

docker run -d -p 8080:80 --name webserver nginx

-d = detached (background), -p host:container port mapping, --name gives it a stable name. Always name containers for easier management.

Safety: Inspect state before stopping, pruning, or changing running containers.

Build the habit: DockerDrill drills docker run and the rest of the Docker workflow until the safe first move is automatic. Try a Docker drill.