0
0
Dockerdevops~10 mins

Compose profiles for selective services 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 define a service named web in a Docker Compose file.

Docker
services:
  web:
    image: nginx
    [1]: "80:80"
Drag options to blanks, or click blank then click option'
Avolumes
Bnetworks
Cports
Ddepends_on
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'volumes' instead of 'ports' to expose ports.
2fill in blank
medium

Complete the code to add a profile named 'debug' to the service 'app'.

Docker
services:
  app:
    image: myapp
    profiles:
      - [1]
Drag options to blanks, or click blank then click option'
Adebug
Btest
Cproduction
Drelease
Attempts:
3 left
💡 Hint
Common Mistakes
Using a profile name that is not defined or intended.
3fill in blank
hard

Fix the error in the profile definition for the service 'db'.

Docker
services:
  db:
    image: postgres
    profiles: [1]
Drag options to blanks, or click blank then click option'
A[debug]
B['debug']
C- debug
Ddebug
Attempts:
3 left
💡 Hint
Common Mistakes
Writing profiles as a plain string instead of a list.
4fill in blank
hard

Fill both blanks to define two services with profiles 'frontend' and 'backend'.

Docker
services:
  ui:
    image: ui-image
    profiles:
      - [1]
  api:
    image: api-image
    profiles:
      - [2]
Drag options to blanks, or click blank then click option'
Afrontend
Bbackend
Cdatabase
Dcache
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing profile names between frontend and backend services.
5fill in blank
hard

Fill all three blanks to create a service with a profile and port mapping.

Docker
services:
  cache:
    image: redis
    profiles:
      - [1]
    ports:
      - "[2]:[3]"
Drag options to blanks, or click blank then click option'
Acache
B6379
Dredis
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong port numbers or mismatching profile names.