General Docker VII
1.
What is the purpose of the 'docker manifest push' command?
To configure Docker networking
To upload Docker secrets to a registry
To deploy a Docker service
To push a multi-architecture Docker image manifest to a registry
2.
What does the 'docker ps -q' command do?
Shows detailed information about running containers
Displays only the container IDs
Lists all containers, including stopped ones
Filters containers based on their status
3.
How can you remove all unused Docker objects, including containers, images, and volumes?
docker remove unused
docker clean
docker system prune -a
docker garbage-collect
4.
What is the purpose of the '--isolation' option when running a Docker container?
To specify the container's network mode
To set the container isolation technology
To define the build context
To expose ports for inter-container communication
5.
What is the purpose of Docker volumes in containerization?
To isolate containers from each other
To enhance container security
To persist data outside the container
To improve container performance
6.
What is the purpose of the Dockerfile instruction ARG?
To specify the base image
To set environment variables
To define build-time variables
To configure the container's entry point
7.
How do you pass environment variables to a Docker container during runtime?
docker set-env VAR_NAME=value
docker run -e VAR_NAME=value
docker env VAR_NAME=value
docker set VAR_NAME=value
8.
How do you display the real-time resource usage of a running Docker container?
docker show stats container_id
docker top container_id
docker monitor container_id
docker stats container_id
9.
How can you configure the default log driver for the Docker daemon?
docker configure daemon --log-driver
Edit the /etc/docker/daemon.json file
docker daemon --log-driver
docker set daemon --log-driver
10.
How can you remove all Docker containers, regardless of their state?
docker rm -f $(docker ps -a -q)
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
docker prune containers
docker remove all containers
11.
How do you expose multiple ports when running a Docker container?
docker run --expose port1 --expose port2
docker run -p port1:port1 -p port2:port2
docker run -p port1,port2
docker run --port port1,port2
12.
How can you set the timezone inside a Docker container?
Use the `TZ` environment variable
Edit the /etc/timezone file
Run the `timedatectl` command
Modify the /etc/localtime file
13.
What is the purpose of the '--link' option when running a Docker container?
To enable communication between containers
To create a symbolic link inside the container
To link containers' file systems
To expose a container to the host network
14.
How can you build a Docker image using a specific Dockerfile located in a different directory?
docker build -t image_name -f /path/to/Dockerfile
docker build -t image_name /path/to/Dockerfile
docker build -t image_name --file /path/to/Dockerfile
docker build -t image_name --context /path/to/Dockerfile
15.
What is the purpose of the '--storage-opt' option when configuring Docker storage drivers?
To set options for container storage
To define the working directory for storage
To specify the container's network mode
To configure options for the storage driver
16.
How can you list the environment variables of a running Docker container?
docker show env container_id
docker env container_id
docker exec container_id env
docker inspect container_id
17.
What does the 'docker history' command show?
Changes made to the Docker daemon
Details of running containers
Logs of a Docker container
Layers and instructions of a Docker image
18.
How can you log in to a private Docker registry?
docker access registry_url
docker authenticate registry_url
docker registry login registry_url
docker login registry_url
19.
How can you create a Docker network with a specific driver?
docker network -d driver_name create network_name
docker create network --driver driver_name network_name
docker network create --driver driver_name network_name
docker new network --driver driver_name network_name
20.
What is the purpose of the 'docker volume create --driver' command?
To create a Docker volume with a specific driver
To configure Docker network settings
To manage Docker secrets
To create a Docker service