0
0
Dockerdevops~10 mins

Multiple Compose files (override) in Docker - Interactive Code Practice

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

Complete the command to start services using the default Compose file.

Docker
docker-compose [1]
Drag options to blanks, or click blank then click option'
Aup
Bbuild
Cstart
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'build' instead of 'up' to start services
Using 'start' which only starts existing containers
Using 'run' which runs a one-off command
2fill in blank
medium

Complete the command to use an override Compose file named docker-compose.override.yml.

Docker
docker-compose -f docker-compose.yml -f [1] up
Drag options to blanks, or click blank then click option'
Adocker-compose.prod.yml
Bdocker-compose.extra.yml
Cdocker-compose.dev.yml
Ddocker-compose.override.yml
Attempts:
3 left
💡 Hint
Common Mistakes
Using a production or development file instead of the override file
Forgetting to specify the override file with -f
3fill in blank
hard

Fix the error in the command to apply multiple Compose files for override.

Docker
docker-compose -f [1] -f docker-compose.override.yml up
Drag options to blanks, or click blank then click option'
Adocker-compose.override.yml
Bdocker-compose.yml
Cdocker-compose.prod.yml
Ddocker-compose.dev.yml
Attempts:
3 left
💡 Hint
Common Mistakes
Using the override file as the first file
Using a production or development file instead of the base file
4fill in blank
hard

Fill both blanks to override the environment variable DEBUG to true in the override file.

Docker
services:
  app:
    [2]:
      DEBUG: [1]
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cenvironment
Dports
Attempts:
3 left
💡 Hint
Common Mistakes
Setting DEBUG to 'false' instead of 'true'
Using 'ports' instead of 'environment' key
5fill in blank
hard

Fill all three blanks to correctly merge two Compose files where the override changes the image and adds a volume.

Docker
version: '3'
services:
  web:
    image: [1]
    volumes:
      - [2]
    [3]
Drag options to blanks, or click blank then click option'
Anginx:latest
B./data:/var/www/html
Cports
Dnginx:stable
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong image tag
Forgetting to add the volume mapping
Missing the ports key for exposing ports