Getting started, topic 10 of 41
Your first containers
docker run pulls an image if needed, creates a container and starts it. Learn its common flags: -d to run in the background, -it for an interactive shell, --name, --rm to remove it when it stops, -p to publish a port and -e to set a variable.
Then learn the life of a container: docker ps -a lists them, docker stop and docker start stop and restart one, and docker rm removes it. A stopped container keeps its writable layer until it is removed.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.
Elsewhere
- Running containersOfficial
- docker container run referenceOfficial