Docker Secrets MCQs with answers Page - 1

You will find multiple-choice questions (MCQs) related to #Docker Secrets here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 825.56K Points
Coach

Q. What is the primary use of Docker secrets?

  • (A) Managing container logs
  • (B) Handling container volumes
  • (C) Storing sensitive information securely
  • (D) Scheduling container tasks

A

Admin • 825.56K Points
Coach

Q. Which Docker mode supports secrets management?

  • (A) Standalone mode
  • (B) Docker Compose
  • (C) Docker Swarm mode
  • (D) Dockerfile mode

A

Admin • 825.56K Points
Coach

Q. Where are Docker secrets stored?

  • (A) In the container image
  • (B) In the host file system
  • (C) In memory of the Swarm manager
  • (D) In Docker Hub

A

Admin • 825.56K Points
Coach

Q. How do you create a Docker secret from a file?

Code:
echo 'mypassword' > secret.txt
docker secret create db_pass secret.txt
  • (A) docker secret add db_pass secret.txt
  • (B) docker secret create db_pass secret.txt
  • (C) docker secret insert db_pass secret.txt
  • (D) docker secret make db_pass secret.txt

A

Admin • 825.56K Points
Coach

Q. How can a container access a secret in Docker Swarm?

  • (A) As environment variables
  • (B) Via mounted file in /run/secrets/
  • (C) Through Docker logs
  • (D) Directly from the Docker CLI

A

Admin • 825.56K Points
Coach

Q. Which of the following command lists all secrets in Docker Swarm?

  • (A) docker secrets
  • (B) docker secret list
  • (C) docker secret show
  • (D) docker secret inspect

A

Admin • 825.56K Points
Coach

Q. Can Docker secrets be used in non-Swarm containers?

  • (A) Yes, always
  • (B) No, secrets are only for Swarm services
  • (C) Yes, with environment variables
  • (D) Yes, through bind mounts

A

Admin • 825.56K Points
Coach

Q. What is the default directory where secrets are mounted inside the container?

  • (A) /etc/docker/secrets/
  • (B) /var/lib/docker/secrets/
  • (C) /run/secrets/
  • (D) /docker/secrets/

A

Admin • 825.56K Points
Coach

Q. How do you remove a Docker secret?

  • (A) docker secret delete
  • (B) docker secret rm
  • (C) docker secret remove
  • (D) docker secret erase

A

Admin • 825.56K Points
Coach

Q. Are Docker secrets encrypted at rest?

  • (A) Yes
  • (B) No
  • (C) Only on Linux systems
  • (D) Only if TLS is enabled
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More