A private Docker registry is a secure place where you can store and share your Docker images within your organization, instead of using public registries like Docker Hub.
Click to reveal answer
beginner
Which Docker command starts a private registry container?
The command is docker run -d -p 5000:5000 --name registry registry:2. It runs the official registry image on port 5000.
Click to reveal answer
intermediate
Why do you need to configure Docker clients to trust a private registry?
Because private registries often use self-signed certificates or run without HTTPS, Docker clients must be told to trust them to allow pushing and pulling images.
Click to reveal answer
beginner
How do you tag an image to push it to your private registry?
Use docker tag <image> localhost:5000/<image> to tag the image with the private registry address before pushing.
Click to reveal answer
beginner
What is the purpose of the docker push command in setting up a private registry?
It uploads your Docker image to the private registry so others can pull and use it.
Click to reveal answer
Which port does the default Docker private registry listen on?
A8080
B80
C443
D5000
✗ Incorrect
The default Docker registry container listens on port 5000.
What command starts a Docker registry container?
Adocker build registry
Bdocker run -d -p 5000:5000 --name registry registry:2
Cdocker start registry
Ddocker push registry
✗ Incorrect
This command runs the official Docker registry image as a container on port 5000.
Before pushing an image to a private registry, what must you do?
ATag the image with the registry address
BDelete the image
CRun docker pull
DRestart Docker daemon
✗ Incorrect
You must tag the image with the private registry's address to push it there.
Why might you need to configure Docker to trust your private registry?
ABecause private registries require a password
BBecause Docker only trusts public registries
CBecause it may use self-signed certificates or no HTTPS
DBecause Docker needs a license
✗ Incorrect
Private registries often use self-signed certificates or run without HTTPS, so Docker must be configured to trust them.
What does the docker push command do?
AUploads an image to a registry
BDownloads an image from a registry
CDeletes an image locally
DBuilds a new image
✗ Incorrect
The docker push command uploads your image to the specified registry.
Explain the steps to set up a private Docker registry and push an image to it.
Think about starting the registry, preparing the image, and uploading it.
You got /4 concepts.
Why is it important to configure Docker clients to trust a private registry, and how can this be done?
Focus on security and Docker client settings.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of setting up a private Docker registry?
easy
A. To automatically update Docker images from Docker Hub
B. To speed up Docker container execution
C. To store Docker images securely within your own network
D. To monitor running Docker containers
Solution
Step 1: Understand what a Docker registry does
A Docker registry stores Docker images so they can be shared and reused.
Step 2: Identify the benefit of a private registry
A private registry keeps images secure and accessible only within your network.
Final Answer:
To store Docker images securely within your own network -> Option C
Quick Check:
Private registry = secure image storage [OK]
Hint: Private registry means secure image storage inside your network [OK]
Common Mistakes:
Confusing registry with container runtime
Thinking it speeds up container execution
Assuming it automatically updates images
2. Which command correctly starts a private Docker registry on port 5000?
easy
A. docker start registry -p 5000:5000
B. docker build -t registry:5000 .
C. docker create registry -p 5000:5000
D. docker run -d -p 5000:5000 --name registry registry:2
Solution
Step 1: Identify the correct Docker command to run a container
The command to start a container is 'docker run' with port mapping.
Step 2: Check the syntax for running the registry image
docker run -d -p 5000:5000 --name registry registry:2 uses 'docker run -d -p 5000:5000 --name registry registry:2' which is correct.
Final Answer:
docker run -d -p 5000:5000 --name registry registry:2 -> Option D
Quick Check:
Run container with port 5000 mapped = docker run -d -p 5000:5000 --name registry registry:2 [OK]
Hint: Use 'docker run -d -p 5000:5000' to start registry container [OK]
Common Mistakes:
Using 'docker start' instead of 'docker run'
Confusing 'docker create' with 'docker run'
Trying to build instead of run the registry image
3. After running a private registry on localhost:5000, what is the correct command to tag an image named myapp for pushing to this registry?
medium
A. docker tag myapp localhost:5000/myapp
B. docker push myapp localhost:5000/myapp
C. docker tag localhost:5000/myapp myapp
D. docker run myapp localhost:5000/myapp
Solution
Step 1: Understand tagging for private registry
To push an image to a private registry, you must tag it with the registry address first.
Step 2: Identify the correct tag command
docker tag myapp localhost:5000/myapp uses 'docker tag myapp localhost:5000/myapp' which correctly tags the image.
Final Answer:
docker tag myapp localhost:5000/myapp -> Option A
Quick Check:
Tag image with registry address before push = docker tag myapp localhost:5000/myapp [OK]
Hint: Tag image as 'localhost:5000/name' before pushing [OK]
Common Mistakes:
Trying to push without tagging first
Reversing tag source and target
Using 'docker run' instead of 'docker tag'
4. You tried to push an image to your private registry but got an error: denied: requested access to the resource is denied. What is the most likely cause?
medium
A. The registry container is not running
B. The image was not tagged with the private registry address
C. Docker daemon is not installed
D. The image name contains invalid characters
Solution
Step 1: Understand the error meaning
The error means Docker cannot find the image at the specified registry path.
Step 2: Check tagging before pushing
If the image is not tagged with the private registry address, push will fail with this error.
Final Answer:
The image was not tagged with the private registry address -> Option B
Quick Check:
Push denied = missing correct tag [OK]
Hint: Check if image is tagged with registry address before push [OK]
Common Mistakes:
Assuming registry container is stopped without checking
Thinking Docker daemon is missing
Blaming image name format without evidence
5. You want to secure your private Docker registry with TLS. Which of these steps is necessary to enable HTTPS access?
hard
A. Mount your TLS certificate and key into the registry container and configure the registry to use them
B. Run the registry container with the --tls flag without any certificates
C. Tag images with https:// prefix before pushing
D. Use Docker Hub instead of a private registry
Solution
Step 1: Understand TLS setup for private registry
To enable HTTPS, the registry needs valid TLS certificates mounted and configured.
Step 2: Identify correct method to provide TLS certs
Mounting the certificate and key files into the container and configuring the registry is required.
Final Answer:
Mount your TLS certificate and key into the registry container and configure the registry to use them -> Option A
Quick Check:
TLS requires certs mounted and configured [OK]
Hint: Mount TLS certs into registry container for HTTPS [OK]
Common Mistakes:
Expecting a --tls flag to work without certs
Tagging images with https:// prefix
Using Docker Hub instead of securing private registry
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.