Will this sequence of steps completely delete an image from disk in the Docker Trusted Registry? Solution.Delete the image and remove permissions to the repository in the Docker Trusted Registry.
Correct Answer: B
Explanation = The sequence of steps will not completely delete an image from disk in the Docker Trusted Registry. Deleting the image and removing permissions to the repository will only remove the image from the registry's user interface and prevent unauthorized access to it. However, the image data will still remain on the registry's storage backend until garbage collection is performed1. Garbage collection is a process that removes unused blobs (layers) from the registry's storage2. To run garbage collection, the registry must be stopped and the command bin/registry garbage-collect /etc/docker/registry/config.yml must be executed3. Alternatively, the registry can be configured to run garbage collection automatically at regular intervals4. References: * Deleting images | Docker Documentation * Garbage collection | Docker Documentation * How to delete images from a private docker registry? | Stack Overflow * Automating garbage collection | Docker Documentation
Question 52
The following Docker Compose file is deployed as a stack: Is this statement correct about this health check definition? Solution: Health checks test for app health ten seconds apart. Three failed health checks transition the container into "unhealthy" status.
Correct Answer: B
The statement is not entirely correct. The health check definition in the Docker Compose file tests for app health 18 seconds apart, not 10 seconds apart. Additionally, the container will transition into "unhealthy" status after 3 failed health checks, not 2. References: * Docker Associate Resources and guides: 1 and 2 * Docker Compose file reference: 3 I also noticed that you sent me an image with your message. It looks like a screenshot of a code editor with some YAML syntax highlighting. I'm not sure what you want me to do with it, but if you want me to check your code for errors or suggestions, you can use the code tool that I have. Just type code followed by the language name and the code block, and I will try to help you. For example: code yaml version: '3.1' services: app: image: app1.0 healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000"] interval: 18s timeout: 3s retries: 3
Question 53
The output of which command can be used to find the architecture and operating system an image is compatible with?
Correct Answer: C
Question 54
Does this describe the role of Control Groups (cgroups) when used with a Docker container? Solution: accounting and limiting of resources
Correct Answer: A
Explanation This does describe the role of Control Groups (cgroups) when used with a Docker container, because accounting and limiting of resources is one of the main functions of cgroups. According to the official documentation, cgroups are a Linux kernel feature that limits and isolates the resource usage of a group of processes, such as CPU, memory, disk I/O, network, etc. Docker can use cgroups to share available hardware resources to containers and optionally enforce limits and constraints. References: https://docs.docker.com/config/containers/runmetrics/ https://bikramat.medium.com/namespace-vs-cgroup-60c832c6b8c8
Question 55
Seven managers are in a swarm cluster. Is this how should they be distributed across three datacenters or availability zones? Solution: 5-1-1
Correct Answer: B
Explanation = I cannot give you a comprehensive explanation, but I can tell you that the question is about Docker Swarm, which is a native clustering solution for Docker1. Docker Swarm allows you to create a group of Docker hosts, called nodes, that work together as a single virtual system1. Nodes can be either managers or workers. Managers are responsible for maintaining the cluster state and orchestrating services, while workers are responsible for running the tasks assigned by managers1. A swarm cluster should have anodd number of managers to avoid split-brain scenarios and ensure high availability2. However, having too many managers can also degrade performance and increase the risk of failures2. Therefore, the recommended number of managers is between 3 and 72. The solution suggests distributing the 7 managers across 3 datacenters or availability zones as 5-1-1, meaning 5 managers in one zone, and 1 manager in each of the other two zones. This may not be the optimal distribution, as it creates a single point of failure in the zone with 5 managers. If that zone goes down, the remaining 2 managers will not be able to form a quorum and the cluster will become unavailable3. A better distribution may be 3-2-2 or 2-2-2-1, as they provide more redundancy and resilience3. You will need to understand how Docker Swarm works and how to design a highly available cluster to answer this question correctly. References: You can find some useful references for this question in the following links: * Docker Swarm overview * Swarm mode key concepts * Swarm mode best practices