πŸ“Š Docker
Q. How do you create a Docker config?
  • (A) docker config create <name> <file>
  • (B) docker config add <name> <value>
  • (C) docker create config <name> <file>
  • (D) docker-compose config create <name> <file>
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker config create <name> <file>

Explanation: The correct syntax to create a Docker config is `docker config create <name> <file>`.

πŸ“Š Docker
Q. Can Docker configs be updated after being attached to a service?
  • (A) Yes, they update automatically
  • (B) No, they are immutable
  • (C) Yes, using docker config update
  • (D) Yes, if the container is restarted
πŸ’¬ Discuss
βœ… Correct Answer: (B) No, they are immutable

Explanation: Docker configs are immutable. To change a config, you must create a new one and update the service.

πŸ“Š Docker
Q. Which command lists all Docker configs?
  • (A) docker config ls
  • (B) docker config list
  • (C) docker list configs
  • (D) docker configs show
πŸ’¬ Discuss
βœ… Correct Answer: (A) docker config ls

Explanation: `docker config ls` lists all available configs.

πŸ“Š Docker
Q. What is the difference between Docker secrets and Docker configs?
  • (A) Configs are for sensitive data, secrets are not
  • (B) Secrets are versioned, configs are not
  • (C) Secrets are encrypted, configs are not
  • (D) There is no difference
πŸ’¬ Discuss
βœ… Correct Answer: (C) Secrets are encrypted, configs are not

Explanation: Secrets are encrypted and stored securely; configs are used for non-sensitive data and are not encrypted.

πŸ“Š Docker
Q. Which of the following is true about configs and services?
  • (A) Configs must be manually copied into containers
  • (B) Configs are accessible via environment variables
  • (C) Configs can be mounted as files in the container
  • (D) Configs can only be used with Docker volumes
πŸ’¬ Discuss
βœ… Correct Answer: (C) Configs can be mounted as files in the container

Explanation: Docker mounts configs as files in the container at runtime.

πŸ“Š Docker
Q. What happens if a service is updated with a new config?
  • (A) The config is merged with the old one
  • (B) The old config is modified
  • (C) The old config is deleted
  • (D) A new config must be created and the service updated
πŸ’¬ Discuss
βœ… Correct Answer: (D) A new config must be created and the service updated

Explanation: Configs are immutable; to update, a new config must be created and attached to the service.

πŸ“Š Docker
Q. Which of the following file types is commonly stored in Docker configs?
  • (A) .zip
  • (B) .tar.gz
  • (C) .conf
  • (D) .pem
πŸ’¬ Discuss
βœ… Correct Answer: (C) .conf

Explanation: Docker configs are typically used to store plain-text config files such as `.conf`, `.json`, etc.

πŸ“Š Docker
Q. What does the command `docker config inspect <config_name>` do?
  • (A) Edits the config
  • (B) Deletes the config
  • (C) Displays the config metadata and content
  • (D) Downloads the config
πŸ’¬ Discuss
βœ… Correct Answer: (C) Displays the config metadata and content

Explanation: `docker config inspect` shows metadata and optionally the content of the specified config.

πŸ“Š Docker
Q. Which option is required when using configs in `docker service create`?
  • (A) --env
  • (B) --mount
  • (C) --config
  • (D) --volume
πŸ’¬ Discuss
βœ… Correct Answer: (C) --config

Explanation: To use configs with services, the `--config` flag is used during `docker service create`.

πŸ“Š Docker
Q. Docker configs are best suited for which of the following?
  • (A) Storing database passwords
  • (B) Logging configuration files
  • (C) Mounting persistent data volumes
  • (D) Container runtime settings
πŸ’¬ Discuss
βœ… Correct Answer: (B) Logging configuration files

Explanation: Configs are suitable for storing non-sensitive files like logging or application configuration files.