Pull an image
Container images are read-only templates. Pulling one downloads its
layers and registers them with your local Docker daemon.
docker pull nginx:alpine
Run docker images to verify it landed:
docker images
When ready, click Verify step.
Hint
Try `docker pull nginx:alpine`.
Run a container
Start an nginx instance from the image you just pulled, exposing port 80
inside the container to port 8080 on the sandbox.
docker run -d -p 8080:80 --name web nginx:alpine
Confirm it's listening:
docker ps
curl -s http://localhost:8080 | head -5
Open the Preview tab on the right to see the nginx default page
rendered inside the lab.
Hint
`docker run -d -p 8080:80 nginx:alpine`
Clean up
Containers cost nothing when they're not running, but leaving them
around clutters the daemon. Stop and remove everything you started:
docker stop web
docker rm web
docker rmi nginx:alpine
You should now see an empty list:
docker ps -a
docker images
Hint
`docker stop $(docker ps -q)` then `docker rm $(docker ps -aq)`