Most used commands command explain shorthand docker image ls Lists all images docker images
docker image rm
Removes an image
docker rmi
docker image pull
Pulls image from a docker registry
docker pull
docker container ls -a Lists all containers docker ps -a
docker container run
Runs a container from an image
docker run
docker container rm Removes a container docker rm
docker container stop Stops a container docker stop
docker container exec Executes a command inside the container docker exec
EXERCISE 1.1: GETTING STARTED Since we already did "Hello, World!" in the material let's do something else.
Start 3 containers from an image that does not automatically exit (such as nginx) in detached mode.
Stop two of the containers and leave one container running.
Submit the output for docker ps -a which shows 2 stopped containers and one running.
EXERCISE 1.2: CLEANUP We have containers and an image that are no longer in use and are taking up space. Running docker ps -a and docker image ls will confirm this.
Clean the Docker daemon by removing all images and containers.
Submit the output for docker ps -a and docker image ls