0
0
Dockerdevops~10 mins

Docker login and authentication - Interactive Code Practice

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

Complete the command to log in to Docker Hub.

Docker
docker [1]
Drag options to blanks, or click blank then click option'
Abuild
Bpush
Crun
Dlogin
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker push' instead of 'docker login'.
Using 'docker run' which starts containers, not login.
2fill in blank
medium

Complete the command to log in to a private Docker registry at example.com.

Docker
docker login [1]
Drag options to blanks, or click blank then click option'
Alocalhost
Bdocker.io
Cexample.com
Dregistry.hub.docker.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default Docker Hub URL instead of the private registry URL.
Leaving the registry URL blank when logging into a private registry.
3fill in blank
hard

Fix the error in the command to log in with a username.

Docker
docker login -u [1]
Drag options to blanks, or click blank then click option'
Amyusername
B-p
Cpassword
D--password
Attempts:
3 left
💡 Hint
Common Mistakes
Putting password or flags instead of username after -u.
Confusing -u with -p.
4fill in blank
hard

Fill both blanks to log in with username and password in one command.

Docker
docker login -u [1] -p [2]
Drag options to blanks, or click blank then click option'
Amyuser
Bmypassword
Cpassword123
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping username and password positions.
Using flags instead of actual username or password.
5fill in blank
hard

Fill all three blanks to create a Docker config file with authentication for a registry.

Docker
echo '{"auths": {"[1]": {"auth": "[2]"}}}' > [3]
Drag options to blanks, or click blank then click option'
Aexample.com
BdXNlcjpwYXNz
C~/.docker/config.json
Ddocker.io
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain text credentials instead of base64 encoded string.
Writing to wrong file path.
Using wrong registry URL.