Challenge - 5 Problems
GitLab CI Docker Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
GitLab CI Runner Docker Image Output
What is the output of the following command when run inside a GitLab CI job using the official Docker image
docker:latest?Docker
docker --versionAttempts:
2 left
💡 Hint
The official Docker image used in GitLab CI jobs includes the Docker CLI by default.
✗ Incorrect
The
docker:latest image includes the Docker CLI, so running docker --version inside a job will result in the Docker version being printed.❓ Configuration
intermediate2:00remaining
Correct Docker-in-Docker Service Configuration
Which GitLab CI configuration snippet correctly enables Docker-in-Docker (DinD) service for building Docker images inside a job?
Attempts:
2 left
💡 Hint
DinD requires connecting to the Docker daemon over TCP and disabling TLS cert directory.
✗ Incorrect
The correct setup uses the
docker:dind service with DOCKER_HOST set to tcp://docker:2375 and disables TLS by setting DOCKER_TLS_CERTDIR to an empty string.🔀 Workflow
advanced3:00remaining
Order of Steps to Build and Push Docker Image in GitLab CI
Arrange the following steps in the correct order to build and push a Docker image using GitLab CI with Docker-in-Docker service.
Attempts:
2 left
💡 Hint
You must prepare the environment before logging in and building images.
✗ Incorrect
First, set up the DinD service and variables (4), then login to the registry (1), build the image (2), and finally push it (3).
❓ Troubleshoot
advanced2:00remaining
Diagnosing Docker Push Failure in GitLab CI
A GitLab CI job using Docker-in-Docker fails with the error:
denied: requested access to the resource is denied when pushing an image. What is the most likely cause?Attempts:
2 left
💡 Hint
Access denied errors usually relate to authentication.
✗ Incorrect
The error indicates the push was rejected due to lack of permission, commonly caused by missing or wrong login credentials.
✅ Best Practice
expert3:00remaining
Best Practice for Secure Docker-in-Docker Usage in GitLab CI
Which practice is recommended to securely use Docker-in-Docker in GitLab CI pipelines?
Attempts:
2 left
💡 Hint
Security is important when exposing Docker daemon.
✗ Incorrect
Enabling TLS and using certificates protects the Docker daemon communication, which is best practice for DinD security.