0
0
Dockerdevops~10 mins

Why advanced Compose features matter in Docker - Test Your Understanding

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

Complete the code to start services defined in a Compose file.

Docker
docker-compose [1]
Drag options to blanks, or click blank then click option'
Astop
Bbuild
Crm
Dup
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'build' instead of 'up' starts only the build process, not the containers.
Using 'stop' or 'rm' stops or removes containers, not starts them.
2fill in blank
medium

Complete the code to run Compose in detached mode (in the background).

Docker
docker-compose up [1]
Drag options to blanks, or click blank then click option'
A-d
B--force-recreate
C--remove-orphans
D--build
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--build' only rebuilds images but does not detach.
Using '--force-recreate' recreates containers but does not detach.
3fill in blank
hard

Fix the error in the Compose command to remove stopped containers.

Docker
docker-compose [1]
Drag options to blanks, or click blank then click option'
Arm
Bdown
Cstop
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'down' removes containers and networks but is more destructive.
Using 'stop' only stops containers but does not remove them.
4fill in blank
hard

Fill both blanks to specify a Compose file and project name.

Docker
docker-compose [1] docker-compose.yml [2] myproject up
Drag options to blanks, or click blank then click option'
A-f
B-p
C--file
D--project-name
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--file' and '--project-name' works but is longer; here short flags are expected.
Mixing flags or missing one causes errors.
5fill in blank
hard

Fill all three blanks to create a service with environment variables and restart policy.

Docker
services:
  web:
    image: nginx
    environment:
      - [1]=production
    restart: [2]
    ports:
      - "80:80"
    deploy:
      replicas: [3]
Drag options to blanks, or click blank then click option'
AENV
Balways
C3
DMODE
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'MODE' instead of 'ENV' for environment variable key.
Using '3' as restart policy instead of number of replicas.