DCA practice question 11 of 25
An application image runs in multiple environments, with each environment using different certificates and ports. Is this a way to provision configuration to containers at runtime? Solution: Provision a Docker config object for each environment.
Full set: 191 questionsDocker configs are a feature designed specifically for managing non-sensitive application configuration data for services running in a Docker Swarm. They allow you to decouple configuration from the application image, which is a containerization best practice. By creating a separate config object for each environment (e.g., dev-certs, prod-certs), you can mount the appropriate configuration into the service at runtime. This enables the use of a single, immutable application image across multiple environments, with each environment receiving its specific certificates, ports, or other settings when the service is deployed.
B: This is incorrect because using Docker configs is the standard, intended method for managing environment-specific, non-sensitive configuration files for services in a Docker Swarm.
1. Docker Docs, "Store configuration data using Docker Configs". The documentation states, "Docker configs are useful for storing non-sensitive information... You can add or remove configs from a service at any time." This directly supports the proposed solution. (Docker Inc., "Store configuration data using Docker Configs", docs.docker.com/engine/swarm/configs/)
2. Docker Docs, docker config create command reference. The purpose is described as "Creates a config from a file or STDIN." This is the command used to implement the solution. (Docker Inc., "docker config create", docs.docker.com/engine/reference/commandline/configcreate/)
3. Docker Docs, docker service create command reference. The --config flag is detailed as the mechanism to "Specify configuration file", attaching the created config object to a service at runtime. (Docker Inc., "docker service create", docs.docker.com/engine/reference/commandline/servicecreate/#specifying-configuration-files---config)
Keep practicing
Take the free DCA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DCA practice questions
- Question 1Does this command create a swarm service that only listens on port 53 using the UDP proto…
- Question 2Will this command ensure that overlay traffic between service tasks is encrypted? Solutio…
- Question 4Does this describe the role of Control Groups (cgroups) when used with a Docker container…
- Question 5Can this set of commands identify the published port(s) for a container? Solution: docker…
- Question 6Will this command mount the host's '/data' directory to the ubuntu container in read-only…
- Question 7A company's security policy specifies that development and production containers must run…
