Complete the code to create a named volume called 'data_volume'.
docker volume create [1]The command docker volume create data_volume creates a named volume called 'data_volume' for sharing data between containers.
Complete the code to run a container that mounts the named volume 'data_volume' at '/app/data'.
docker run -d -v [1]:/app/data alpine sleep 1000
The -v data_volume:/app/data option mounts the named volume 'data_volume' inside the container at '/app/data'.
Fix the error in the command to mount the named volume 'data_volume' to '/data' inside the container.
docker run -d -v [1]:/data alpine sleep 1000
The correct syntax for mounting a named volume is -v data_volume:/data. Adding slashes or extra characters causes errors.
Fill both blanks to define a service in docker-compose that uses the named volume 'data_volume' mounted at '/data'.
version: '3.8'\nservices:\n app:\n image: alpine\n volumes:\n - [1]:[2]\nvolumes:\n data_volume: {}
In docker-compose, the volume is referenced by its name 'data_volume' and mounted at the container path '/data'.
Fill all three blanks to create a docker-compose service that mounts 'data_volume' at '/data', runs 'sleep 1000', and declares the volume.
version: '3.8'\nservices:\n worker:\n image: alpine\n command: [1]\n volumes:\n - [2]:[3]\nvolumes:\n data_volume: {}
The service runs the command sleep 1000, mounts the named volume 'data_volume' at '/data', and declares the volume under volumes.