0
0
Dockerdevops~10 mins

Volumes in Compose 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 volume named 'data_volume' in the Compose file.

Docker
volumes:
  [1]:
Drag options to blanks, or click blank then click option'
Adata_volume
Bvolume_data
CdataVol
Dvol_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different volume name like 'volume_data' or 'dataVol'.
Misspelling the volume name.
2fill in blank
medium

Complete the service volume mount to use the volume 'data_volume' at path '/app/data'.

Docker
services:
  app:
    volumes:
      - [1]:/app/data
Drag options to blanks, or click blank then click option'
A./data_volume
Bdata_volume
C/data_volume
Dvolume_data
Attempts:
3 left
💡 Hint
Common Mistakes
Adding './' or '/' before the volume name.
Using a wrong volume name like 'volume_data'.
3fill in blank
hard

Fix the error in the volume mount syntax to correctly mount 'data_volume' to '/app/data'.

Docker
services:
  app:
    volumes:
      - [1]:/app/data
Drag options to blanks, or click blank then click option'
Adata_volume-
Bdata_volume
Cdata_volume:
Ddata_volume;
Attempts:
3 left
💡 Hint
Common Mistakes
Using a space instead of a colon between volume and path.
Adding extra characters like '-' or ';' after the volume name.
4fill in blank
hard

Fill both blanks to define a named volume and mount it to '/var/lib/mysql' in the service.

Docker
volumes:
  [1]:
services:
  db:
    volumes:
      - [2]:/var/lib/mysql
Drag options to blanks, or click blank then click option'
Amysql_data
Bmysql_volume
Ddb_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for volume definition and mount.
Misspelling the volume name.
5fill in blank
hard

Fill all three blanks to create a volume with driver 'local' and mount it to '/cache' in the service.

Docker
volumes:
  [1]:
    driver: [2]
services:
  cache:
    volumes:
      - [3]:/cache
Drag options to blanks, or click blank then click option'
Acache_volume
Blocal
Dcache_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using different volume names in definition and mount.
Using incorrect driver names.