0
0
Dockerdevops~5 mins

Docker login and authentication - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the docker login command?
The docker login command is used to authenticate a user to a Docker registry by providing credentials. This allows the user to push or pull private images securely.
Click to reveal answer
beginner
Which file stores Docker login credentials on your local machine?
Docker stores login credentials in a file called config.json located in the ~/.docker/ directory on your local machine.
Click to reveal answer
beginner
How do you log in to a private Docker registry named myregistry.example.com?
Use the command: <br>docker login myregistry.example.com<br>Then enter your username and password when prompted.
Click to reveal answer
beginner
What happens if you try to pull a private image without logging in first?
Docker will return an authentication error because it cannot access private images without valid credentials.
Click to reveal answer
beginner
How can you log out from a Docker registry?
Use the command docker logout [registry]. If no registry is specified, it logs out from Docker Hub by default.
Click to reveal answer
What command do you use to authenticate to Docker Hub?
Adocker login
Bdocker push
Cdocker pull
Ddocker logout
Where does Docker store your login credentials locally?
A~/.docker/config.json
B/etc/docker/credentials
C~/.docker/login.txt
D/var/lib/docker/auth
What will happen if you try to pull a private image without logging in?
ADocker automatically logs you in
BYou get an authentication error
CThe image downloads successfully
DThe image is deleted
How do you log out from Docker Hub?
Adocker disconnect
Bdocker login --logout
Cdocker remove login
Ddocker logout
Which information do you need to provide when running docker login?
AImage name
BContainer ID
CUsername and password
DDockerfile path
Explain the steps to log in to a private Docker registry and why it is necessary.
Think about how you prove your identity to access private content.
You got /4 concepts.
    Describe where Docker stores your login credentials and how you can log out from a registry.
    Consider the local files and commands managing your login state.
    You got /3 concepts.