0
0
Jenkinsdevops~10 mins

Docker compose in pipelines in Jenkins - Interactive Code Practice

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

Complete the code to start Docker Compose services in a Jenkins pipeline.

Jenkins
sh 'docker-compose [1] -d'
Drag options to blanks, or click blank then click option'
Arestart
Bbuild
Cstop
Dup
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' instead of 'up' stops services instead of starting them.
Using 'build' only builds images but does not start containers.
2fill in blank
medium

Complete the code to run Docker Compose with a specific file in a Jenkins pipeline.

Jenkins
sh 'docker-compose -f [1] up -d'
Drag options to blanks, or click blank then click option'
Adocker-compose.prod.yml
Bdocker-compose.yml
Cdocker-compose.override.yml
Ddocker-compose.dev.yml
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default file name when a specific environment file is needed.
Choosing the override or dev file instead of the production file.
3fill in blank
hard

Fix the error in the Jenkins pipeline step to stop Docker Compose services.

Jenkins
sh 'docker-compose [1]'
Drag options to blanks, or click blank then click option'
Akill
Bdown
Cremove
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' only stops containers but does not remove networks or volumes.
Using 'kill' forcefully stops containers but does not clean up.
4fill in blank
hard

Fill both blanks to build and start Docker Compose services in one command.

Jenkins
sh 'docker-compose [1] && docker-compose [2] -d'
Drag options to blanks, or click blank then click option'
Abuild
Bup
Crestart
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'restart' or 'stop' instead of 'build' or 'up'.
Running 'up' before 'build' which may use outdated images.
5fill in blank
hard

Fill all three blanks to run Docker Compose with a specific file, build images, and start services detached.

Jenkins
sh 'docker-compose -f [1] [2] && docker-compose -f [1] [3] -d'
Drag options to blanks, or click blank then click option'
Adocker-compose.yml
Bbuild
Cup
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using different files for build and up commands.
Using 'stop' instead of 'build' or 'up'.