General Docker VI
1.
What is the purpose of the Dockerfile instruction HEALTHCHECK?
To define the health status of a Docker container
To configure network health
To manage Docker volumes health
To specify health-related environment variables
2.
How can you view the Docker system events in real-time?
docker watch
docker monitor
docker events
docker live
3.
How do you remove all Docker volumes, including unused ones?
docker purge volumes
docker remove volumes
docker volume prune -a
docker rm -v $(docker volume ls -q)
4.
What is the purpose of the '--network' option when running a Docker container?
To specify the container's network mode
To create a new network for the container
To assign a specific IP address to the container
To expose the container to the host network
5.
How do you list all Docker images on your system?
docker inspect images
docker show images
docker list images
docker image ls
6.
How can you limit the CPU shares for a running Docker container?
docker limit-cpu
docker set-cpu-shares
docker run --cpu-shares
docker set-cpu
7.
How do you set the working directory in a Dockerfile?
WORKDIR instruction
DIR instruction
SETDIR instruction
CHANGEDIR instruction
8.
What is the role of the Docker image registry 'Quay.io'?
To store and distribute Docker images
To manage Docker containers
To create Docker volumes
To build Docker images
9.
How can you build a Docker image using a specific build context?
docker build -f Dockerfile -t image_name context_path
docker build -t image_name context_path -f Dockerfile
docker build -t image_name -f Dockerfile context_path
docker build context_path -t image_name -f Dockerfile
10.
What is the function of the Docker container orchestration tool 'Kubernetes'?
To configure Docker networks
To build Docker images
To create Docker volumes
To manage and scale containerized applications
11.
What is the purpose of the 'docker exec' command?
To execute a command inside a running Docker container
To create a new Docker container
To stop a running Docker container
To view the logs of a Docker container
12.
What is the purpose of the '--link' option when running a Docker container?
To set environment variables
To link containers for communication
To expose ports to the host
To specify the container's network mode
13.
What is the purpose of the '--rm' option when running a Docker container?
To restart the container automatically
To remove the container after it exits
To run the container in read-only mode
To mount a volume
14.
How do you specify the Docker image version when pulling from a registry?
docker pull image:version
docker pull image@version
docker pull image/version
docker pull image/version:latest
15.
How can you view the IP address of a specific Docker container?
docker show ip container_id
docker ip container_id
docker inspect --format '{{.NetworkSettings.IPAddress}}' container_id
docker get ip container_id
16.
How can you expose a specific port on the host when running a Docker container?
docker run -e host_port:container_port
docker run --expose host_port:container_port
docker run -p host_port:container_port
docker run -x host_port:container_port
17.
How can you remove all Docker images from the local machine?
docker image prune -a
docker rmi -f $(docker images -q)
docker clean images
docker purge -a
18.
What is the purpose of the 'docker-machine' tool?
To build Docker images
To create and manage Docker hosts
To orchestrate Docker deployments
To configure Docker networks
19.
How can you view the details of a specific Docker image?
docker details image_name
docker image info image_name
docker show image_name
docker inspect image_name
20.
What is the purpose of the 'docker manifest push --all' command?
To push all architecture variants of a multi-architecture Docker image manifest to a registry
To upload all Docker secrets to a registry
To deploy a Docker stack
To configure Docker networking