Complete the Docker command to mount a local config file into the nginx container.
docker run -d -p 8080:80 -v [1]:/etc/nginx/nginx.conf:ro nginx
You need to mount your local nginx.conf file into the container's config path. The local path is /home/user/nginx.conf.
Complete the Docker Compose volume syntax to mount a config directory.
volumes:
- [1]:/etc/nginx/conf.d:roThe left side is the local directory path relative to the compose file. Here, './config' is mounted read-only to the container's config directory.
Fix the error in the Docker run command to correctly mount the config file.
docker run -d -p 80:80 -v /home/user/nginx.conf[1] nginx
The volume mount syntax is local_path:container_path. The local config file must be on the left, container path on the right.
Fill both blanks to create a Docker Compose service that mounts a config file read-only.
services:
nginx:
image: nginx
volumes:
- [1]:[2]:roThe local config file './nginx.conf' is mounted read-only to the container path '/etc/nginx/nginx.conf'.
Fill all three blanks to define a Docker Compose volume mount for a config directory with read-only access.
services:
webserver:
image: nginx
volumes:
- [1]:[2]:[3]The local directory './config' is mounted read-only ('ro') to the container directory '/etc/nginx/conf.d'.