Bird
0
0

After running:

medium📝 Predict Output Q4 of 15
Docker - Security
After running:
docker service create --name backend --secret api_token nginx

how is the secret api_token made available inside the container?
AInjected as an environment variable named API_TOKEN
BMounted as a file in <code>/run/secrets/api_token</code>
CStored in a temporary database inside the container
DPassed as a command-line argument to the container
Step-by-Step Solution
Solution:
  1. Step 1: Understand Docker secrets usage in services

    Docker secrets are mounted as files inside the container under /run/secrets/.
  2. Step 2: Verify options

    Only Mounted as a file in /run/secrets/api_token correctly describes this behavior.
  3. Final Answer:

    Mounted as a file in /run/secrets/api_token -> Option B
  4. Quick Check:

    Secrets appear as files, not env vars [OK]
Quick Trick: Secrets appear as files in /run/secrets/ [OK]
Common Mistakes:
  • Assuming secrets are environment variables
  • Thinking secrets are passed as command arguments
  • Believing secrets are stored in container databases

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes