General Docker IX
1.
What is the purpose of the 'docker-compose down' command?
To stop and remove containers defined in a Docker Compose file
To display detailed information about a Docker Compose file
To update the services in a Docker Compose file
To scale services defined in a Docker Compose file
2.
What is the purpose of the '--security-opt' option when running a Docker container?
To specify the container's network mode
To expose ports on the host
To configure the container's entry point
To set security options for the container
3.
How can you inspect the configuration of a Docker swarm node?
docker node inspect node_id
docker inspect node node_id
docker show node node_id
docker details node node_id
4.
How do you set environment variables for a Docker container in a Docker Compose file?
env-vars section in docker-compose.yml
environment section in docker-compose.yml
docker run -e option
docker set-env option
5.
How can you remove all unused Docker networks?
docker rm -i $(docker network ls -q -f dangling=true)
docker remove networks
docker cleanup networks
docker network prune
6.
How can you remove all stopped and running Docker containers?
docker clean -a
docker remove all containers
docker prune containers -a
docker rm -f $(docker ps -a -q)
7.
How can you share data between Docker containers using volumes?
docker run -v shared_volume:/path
docker create -v shared_volume:/path
docker volume create shared_volume
docker mount -v shared_volume:/path
8.
What is the purpose of the 'docker secret create' command in Docker Swarm?
To define environment variables
To encrypt Docker images
To create and manage secrets for Swarm services
To configure Docker networking
9.
How can you override the default entry point of a Docker image when running a container?
docker modify-entrypoint
docker set-entrypoint
docker run --entrypoint
docker override-entrypoint
10.
How can you limit the memory usage of a Docker container?
docker limit-memory
docker set-memory
docker run -m
docker assign-memory
11.
What is the purpose of the 'docker plugin' command?
To display information about running containers
To configure Docker network settings
To inspect Docker volumes
To manage Docker plugins
12.
How can you build a Docker image from a specific Git repository?
docker build -t image_name --git git_repository_url
docker build -t image_name git_repository_url
docker build -t image_name -f git_repository_url
docker build git_repository_url -t image_name
13.
What does the 'docker-compose logs' command do?
Displays the logs of services defined in a Docker Compose file
Creates logs for Docker Compose services
Lists available logs on the host machine
Shows system-wide logs
14.
How do you copy files from the host to a Docker container during runtime?
docker move host_path container_id:/path
docker copy host_path container_id:/path
docker cp host_path container_id:/path
docker send host_path container_id:/path
15.
What is the purpose of the 'docker events' command?
To display real-time Docker events
To show logs of a Docker container
To list all Docker containers
To inspect a Docker image
16.
What is the purpose of the '--isolation' option when building a Docker image?
To specify the base image
To define the build context
To set the container isolation technology
To expose ports for inter-container communication
17.
How can you display the disk space usage of Docker objects?
docker system df
docker disk-usage
docker space usage
docker show disk
18.
What is the function of the 'docker attach' command?
To create a new Docker container
To attach to a running Docker container's stdin, stdout, and stderr
To stop a running Docker container
To view the logs of a Docker container
19.
What is the purpose of the 'docker update' command?
To update the Docker daemon
To update Docker images
To update the configuration of a running Docker container
To update Docker Compose services
20.
What is the purpose of the '--label' option when creating a Docker container?
To expose the container to the host network
To label Docker images
To specify the container's network mode
To add metadata to the container