Challenge - 5 Problems
Secrets Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Docker Secrets: Inspecting a Secret
What is the output of the command
docker secret inspect my_secret if the secret my_secret exists and contains the text password123?Attempts:
2 left
💡 Hint
The inspect command shows metadata, not the secret content.
✗ Incorrect
The
docker secret inspect command returns metadata about the secret, such as its ID and name, but does not reveal the secret's content for security reasons.🔀 Workflow
intermediate2:00remaining
Using Docker Secrets in a Service
Which of the following is the correct way to create a Docker service that uses a secret named
db_password?Attempts:
2 left
💡 Hint
Docker secrets are added with the --secret flag, not as environment variables or mounts.
✗ Incorrect
To use a secret in a Docker service, you add it with the
--secret flag. The secret is then available inside the container at /run/secrets/db_password.❓ Troubleshoot
advanced2:00remaining
Secret Not Available Inside Container
You created a Docker secret named
api_key and attached it to a service. Inside the container, the secret file /run/secrets/api_key is missing. What is the most likely cause?Attempts:
2 left
💡 Hint
Check how the secret was added to the service.
✗ Incorrect
If the secret is not attached to the service with the
--secret flag, it will not be available inside the container at the expected path.🧠 Conceptual
advanced2:00remaining
Security of Docker Secrets
Which statement best describes how Docker secrets are stored and accessed?
Attempts:
2 left
💡 Hint
Think about how secrets should be protected on disk and in memory.
✗ Incorrect
Docker encrypts secrets at rest in the swarm and only decrypts them in the container's memory, never storing them unencrypted on disk.
✅ Best Practice
expert3:00remaining
Best Practice for Updating Docker Secrets
What is the recommended way to update a Docker secret named
tls_cert without downtime for the service using it?Attempts:
2 left
💡 Hint
Docker secrets are immutable; think about how to switch secrets safely.
✗ Incorrect
Docker secrets cannot be updated in place. The best practice is to create a new secret with a new name, update the service to use it, and then remove the old secret to avoid downtime.