0
0
Dockerdevops~10 mins

Depends_on for service ordering in Docker - Interactive Code Practice

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

Complete the code to specify that service2 should start after service1.

Docker
services:
  service1:
    image: alpine
  service2:
    image: alpine
    depends_on:
      - [1]
Drag options to blanks, or click blank then click option'
Aservice1
Bservice5
Cservice4
Dservice3
Attempts:
3 left
💡 Hint
Common Mistakes
Listing the wrong service name under depends_on.
Forgetting to indent the depends_on list properly.
2fill in blank
medium

Complete the code to make serviceB start only after serviceA is ready.

Docker
services:
  serviceA:
    image: nginx
  serviceB:
    image: nginx
    depends_on:
      - [1]
Drag options to blanks, or click blank then click option'
AserviceC
BserviceD
CserviceA
DserviceE
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the order of services in depends_on.
Using a service name that does not exist.
3fill in blank
hard

Fix the error in the depends_on section to correctly order serviceX after serviceY.

Docker
services:
  serviceX:
    image: redis
    depends_on:
      - [1]
Drag options to blanks, or click blank then click option'
AserviceX
BserviceY
CserviceZ
DserviceW
Attempts:
3 left
💡 Hint
Common Mistakes
Listing the same service as depends_on.
Listing a service that is unrelated.
4fill in blank
hard

Fill both blanks to make serviceAlpha start after serviceBeta and serviceGamma.

Docker
services:
  serviceAlpha:
    image: ubuntu
    depends_on:
      - [1]
      - [2]
Drag options to blanks, or click blank then click option'
AserviceBeta
BserviceDelta
CserviceGamma
DserviceEpsilon
Attempts:
3 left
💡 Hint
Common Mistakes
Including services that are not dependencies.
Forgetting to list both required services.
5fill in blank
hard

Fill all three blanks to make serviceOne start after serviceTwo and serviceThree, and serviceTwo start after serviceFour.

Docker
services:
  serviceOne:
    image: alpine
    depends_on:
      - [1]
      - [2]
  serviceTwo:
    image: alpine
    depends_on:
      - [3]
Drag options to blanks, or click blank then click option'
AserviceTwo
BserviceThree
CserviceFour
DserviceFive
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up which services depend on which.
Forgetting to include serviceFour as a dependency of serviceTwo.