0
0
Dockerdevops~10 mins

Compose file versioning 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 the Compose file version at the top.

Docker
version: '[1]'
services:
  web:
    image: nginx
Drag options to blanks, or click blank then click option'
A3.8
B2.4
C1
Dlatest
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'latest' as version is invalid.
Using a number without quotes.
2fill in blank
medium

Complete the Compose file to define a service named 'db'.

Docker
version: '3.8'
services:
  [1]:
    image: postgres
Drag options to blanks, or click blank then click option'
Acache
Bbackend
Cfrontend
Ddb
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated service names like 'cache' or 'frontend'.
3fill in blank
hard

Fix the error in the Compose file version declaration.

Docker
version: [1]
services:
  app:
    image: alpine
Drag options to blanks, or click blank then click option'
Alatest
B3.7
C'3.7'
D'latest'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the version number.
Using 'latest' which is invalid.
4fill in blank
hard

Fill both blanks to define a Compose file with version and a service named 'cache'.

Docker
version: '[1]'
services:
  [2]:
    image: redis
Drag options to blanks, or click blank then click option'
A3.9
Bdb
Ccache
D2.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using an old version like '2.1'.
Wrong service name like 'db'.
5fill in blank
hard

Fill all three blanks to create a Compose file with version, a service named 'web', and specify the image.

Docker
version: '[1]'
services:
  [2]:
    image: [3]
Drag options to blanks, or click blank then click option'
A3.8
Bweb
Cnginx:latest
Ddb
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'db' as service name instead of 'web'.
Omitting the image tag.