DCA Exam Questions & Answers
Docker Certified Associate Exam • Docker
100% money-back guarantee
Sample DCA Questions
Practice with real exam-style questions, each with the verified correct answer and explanation.
You want to create a container that is reachable from its host's network. Does this action accomplish this?
Solution: Use --link to access the container on the bridge network.
= The action of using--linkto access the container on the bridge network doesnotaccomplish the goal of creating a container that is reachable from its host's network.The--linkoption allows you to connect containers that are running on the same network, but it doesnotexpose the container's ports to the host1.To create a container that is reachable from its host's network, you need to use the--network hostoption, which attaches the container to the host's network stack and makes it share the host's IP address2.Alternatively, you can use the--publishor-poption to map the container's ports to the host's ports3.
: :Legacy container links | Docker Documentation:Networking using the host network | Docker Documentation:docker run reference | Docker Documentation
In Docker Trusted Registry, is this how a user can prevent an image, such as 'nginx:latest', from being overwritten by another user with push access to the repository?
Solution: Tag the image with 'nginx:immutable'.
Tagging the image with 'nginx:immutable' isnothow a user can prevent an image, such as 'nginx:latest', from being overwritten by another user with push access to the repository.Tagging the image with 'nginx:immutable' will only create a new tag for the image, but it will not prevent the original tag from being overwritten.To prevent an image tag from being overwritten in Docker Trusted Registry, the user can use the DTR web UI to make the tag immutable1.This will prevent anyone from pushing a new image with the same tag, even if they have push access to the repository1.Alternatively, the user can also use the DTR API to make the tag immutable2.Reference:Prevent tags from being overwritten), DTR API reference)
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.
= 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 commandbin/registry garbage-collect /etc/docker/registry/config.ymlmust be executed3.Alternatively, the registry can be configured to run garbage collection automatically at regular intervals4.Reference:
Deleting images | Docker Documentation
Garbage collection | Docker Documentation
How to delete images from a private docker registry? | Stack Overflow
Automating garbage collection | Docker Documentation
Will this Linux kernel facility limit a Docker container's access to host resources, such as CPU or memory?
Solution: namespaces
Namespaces are a Linux kernel feature that isolate containers from each other and from the host system. They limit the access of a container to host resources, such as CPU or memory, by creating a separate namespace for each aspect of a container, such as process IDs, network interfaces, user IDs, etc.This way, a container can only see and use the resources that belong to its own namespace, and not those of other containers or the host12.Reference:
Isolate containers with a user namespace | Docker Docs
Docker overview | Docker Docs
Seven managers are in a swarm cluster.
Is this how should they be distributed across three datacenters or availability zones?
Solution: 5-1-1
= 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 an odd 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 3and 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.Reference: You can find some useful references for this question in the following links:
Docker Swarm overview
Swarm mode key concepts
Swarm mode best practices
Get access to all 191 verified questions with detailed answers.
Unlock All DCA Questions