General Docker II
1.
What is the purpose of the "docker system events --format" option?
To format the output of real-time Docker events using a Go template
To filter real-time Docker events based on a specific format
To display system events in a specific format
To configure Docker system settings
2.
How do you inspect a Docker container's configuration?
docker config inspect
docker container inspect
docker inspect config
docker show container
3.
How do you log in to a Docker registry?
docker access
docker authenticate
docker registry login
docker login
4.
What is the purpose of a Docker volume?
To define the container image
To increase container performance
To manage container networking
To store persistent data outside the container
5.
What is the difference between CMD and ENTRYPOINT in a Dockerfile?
CMD defines the command to run when the container starts
ENTRYPOINT defines the command to run when the container starts
CMD cannot be overridden during container runtime
ENTRYPOINT cannot accept arguments
6.
What is the purpose of the Dockerfile instruction EXPOSE?
To specify the base image
To publish ports to the host machine
To define the working directory
To expose ports for inter-container communication
7.
How can you set environment variables in a Dockerfile?
VAR instruction
SET instruction
ENV instruction
EXPORT instruction
8.
What is the purpose of the --network option when running a Docker container?
To create a new network for the container
To specify the container's network mode
To assign a specific IP address to the container
To expose the container to the host network
9.
How can you share a Docker volume between containers?
Use a named volume
Use a mounted volume
Use a linked volume
Use a shared volume
10.
What is the difference between CMD and RUN in a Dockerfile?
CMD is used to execute commands during image build
RUN is used to define the default command to run when the container starts
CMD can be overridden during container runtime
RUN is used to specify commands to run during image build
11.
How do you set the kernel capabilities for a Docker container?
Add the '--cap-add' and '--cap-drop' options to the 'docker run' command
Edit the /etc/docker/capabilities file
Run the 'docker set-capabilities' command
Use the 'docker capabilities' instruction in a Dockerfile
12.
How do you configure Docker to use a specific runtime for running containers?
Edit the /etc/docker/daemon.json file and set the "container-runtime" option
Use the "docker configure daemon --runtime" command
Run the "docker container configure --runtime" command
Edit the /etc/docker/container-runtime file
13.
How can you configure the default container isolation technology for the Docker daemon?
Edit the /etc/docker/daemon.json file
docker configure daemon --isolation
docker daemon --isolation
docker set daemon --isolation
14.
How can you view the layers of a Docker image?
docker inspect
docker layers
docker history
docker show layers
15.
How do you copy files from the host to a Docker container?
docker cp
docker copy
docker move
docker send
16.
What is the purpose of the --rm option when running a Docker container?
To run the container in read-only mode
To restart the container automatically
To remove the container after it exits
To mount a volume
17.
How can you limit the CPU usage of a Docker container?
docker cpu-limit
docker set-cpu
docker limit-cpu
docker run --cpu
18.
How can you remove all unused Docker objects, including containers, images, and volumes?
docker clean
docker prune
docker remove unused
docker garbage-collect
19.
How can you view the events generated by Docker on a system?
docker events
docker log
docker show events
docker history events
20.
What is the purpose of the 'docker manifest create' command?
To create a new Docker image manifest
To initialize a new Docker volume
To manage Docker networks
To configure Docker build settings