Complete the code to run a Docker container that keeps data after it stops.
docker run -d --name mycontainer -v [1]:/data busyboxThe -v option maps a host folder to the container to keep data persistent.
Complete the command to create a named Docker volume called 'myvol'.
docker volume [1] myvolThe create command makes a new named volume in Docker.
Fix the error in the Docker run command to properly mount a volume named 'myvol' to '/app/data'.
docker run -d --name appcontainer -v [1]:/app/data busyboxTo mount a named volume, just use its name without slashes or prefixes.
Fill both blanks to create a Docker volume and run a container using it.
docker volume [1] mydata && docker run -d -v [2]:/data alpine
First, create the volume with create. Then use the volume name mydata to mount it.
Fill all three blanks to define a Docker Compose service with a volume for data persistence.
services:
db:
image: postgres
volumes:
- [1]:[2]
volumes:
[3]:The volume name dbdata is used in both service and volumes sections. The container path is /var/lib/postgresql/data.