0
0
Dockerdevops~10 mins

Secrets management in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to create a Docker secret named 'db_password' from a file.

Docker
docker secret [1] db_password ./password.txt
Drag options to blanks, or click blank then click option'
Ainspect
Blist
Crm
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rm' instead of 'create' deletes secrets instead of creating them.
Using 'list' or 'inspect' only shows secrets but does not create them.
2fill in blank
medium

Complete the Docker service command to use the secret 'db_password'.

Docker
docker service create --name mydb --secret [1] postgres
Drag options to blanks, or click blank then click option'
Amy_secret
Bdb_password
Cpassword
Dsecret_db
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different or incorrect secret name causes the service to fail to find the secret.
3fill in blank
hard

Fix the error in the command to remove a Docker secret named 'db_password'.

Docker
docker secret [1] db_password
Drag options to blanks, or click blank then click option'
Adel
Bremove
Crm
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' or 'del' which are not valid Docker secret commands.
4fill in blank
hard

Fill both blanks to create a Docker secret from a string.

Docker
echo '[1]' | docker secret create [2] -
Drag options to blanks, or click blank then click option'
Amysecretvalue
Bdb_password
Cuser_password
Dsecret_value
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up secret content and secret name.
Using different secret names inconsistently.
5fill in blank
hard

Fill all three blanks to create a Docker service that uses two secrets and sets an environment variable.

Docker
docker service create --name app --secret [1] --secret [2] -e DB_PASS=[3] nginx
Drag options to blanks, or click blank then click option'
Adb_password
Bapi_key
Csecret_env
Ddb_password_value
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing secret names with environment variable values.
Using incorrect secret names.