How do you see the console output of a docker container?... What command is used to build a docker image?... How do you stop a docker container?... What parameter tells docker to run the
Trang 1Each question will be displayed for 10 seconds
If you need more time, just press pause
Trang 2What command will show
running containers?
Trang 3docker ps
Trang 4What command will show all containers? Running and stopped?
Trang 5docker ps -a
Trang 6What is the default tag?
Trang 7‘latest’ is selected if no other
value is specified
Trang 8What command do you use to
run a docker image?
Trang 9docker run <image name>
Trang 10How do you see the console output of a docker container?
Trang 11docker logs <container name>
Trang 12What command is used to build
a docker image?
Trang 13From the directory of the Dockerfile
run:
docker build -t <tag name>
Trang 14How do you stop a docker
container?
Trang 15docker kill <container name>
OR docker stop <container name>
Trang 16What parameter tells docker to run
the container as a background
process?
Trang 17-d Example:
docker run -d <image name>
Trang 18How do you list all docker
images on your system?
Trang 19docker images
Trang 20How do you map a host port to
a container port?
Trang 21-p <host port>:<container port>
Example:
docker run -p 8080:8080 <image name>
Trang 22How do you tail the console output
of a running docker container?
Trang 23docker logs -f <container
name>
Trang 24What is like a java file to a docker
image? ie, the source code?
Trang 25The Dockerfile
Trang 26What command will remove a
stopped docker container?
Trang 27docker rm <container name>
Trang 28How do you specify an environment
variable for a docker container?
Trang 29docker run -e MY_VAR=my_prop
<image name>
Trang 30How do you remove a docker
image from your system?
Trang 31docker rmi <image name>
Trang 32How do you shell into a running
docker container?
Trang 33docker exec -it <container
name> bash
Trang 34How do you share storage on the
host system with a docker
container?
Trang 35-v <host path>:<container path>
Example:
docker run -v <my host path>:<the container
path> <image name>