0
0
Dockerdevops~5 mins

GitLab CI with Docker - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is GitLab CI?
GitLab CI is a tool built into GitLab that helps automate testing, building, and deploying your code using pipelines.
Click to reveal answer
beginner
Why use Docker in GitLab CI pipelines?
Docker lets you run your code in containers, which are like small, consistent environments. This makes sure your code runs the same way everywhere.
Click to reveal answer
beginner
What is a .gitlab-ci.yml file?
It is a file in your project that tells GitLab CI what steps to run, like building or testing your code, and how to run them.
Click to reveal answer
beginner
How do you specify a Docker image in GitLab CI?
You add 'image: ' at the top of your .gitlab-ci.yml file to tell GitLab which Docker image to use for running jobs.
Click to reveal answer
intermediate
What is the purpose of the 'services' keyword in GitLab CI with Docker?
The 'services' keyword lets you run extra Docker containers alongside your job, like a database, so your tests can use them.
Click to reveal answer
In GitLab CI, how do you tell the pipeline to use a specific Docker image?
ABy setting environment variables in GitLab UI
BBy running 'docker run' command in the terminal
CBy installing Docker manually on the runner
DBy adding 'image: <image-name>' in .gitlab-ci.yml
What does the 'services' keyword do in a GitLab CI pipeline?
AStarts the GitLab server
BDefines the main Docker image for the job
CRuns additional Docker containers alongside the job
DUploads artifacts after the job finishes
Which file controls the steps and Docker images used in GitLab CI?
A.gitlab-ci.yml
BDockerfile
CREADME.md
Dconfig.yml
Why is Docker useful in CI pipelines?
AIt creates consistent environments for running code
BIt speeds up internet connection
CIt replaces GitLab entirely
DIt stores code backups
What happens if you don't specify a Docker image in GitLab CI?
ADocker will not be installed
BGitLab uses a default image or the runner's environment
CThe pipeline will fail immediately
DThe job will run on your local machine
Explain how to set up a simple GitLab CI pipeline that uses Docker to run tests.
Think about the file, image, jobs, and running commands.
You got /5 concepts.
    Describe the role of Docker containers in GitLab CI pipelines and why they are helpful.
    Focus on environment consistency and isolation.
    You got /5 concepts.