Complete the code to start an Nginx container using Docker.
docker run -d -p 80:80 [1]
The nginx image runs the Nginx web server inside a container. This command starts it detached and maps port 80.
Complete the command to remove a running Nginx container named 'webserver'.
docker rm -f [1]The docker rm -f command forcefully stops and removes the container named webserver.
Fix the error in the Dockerfile line to copy the Nginx config file.
COPY [1] /etc/nginx/nginx.confThe Nginx main config file is named nginx.conf. Copying this file replaces the default configuration.
Fill both blanks to create a Docker command that runs Nginx with a custom config file from the host.
docker run -d -p 8080:80 -v [1]:/etc/nginx/nginx.conf [2]
The -v option mounts the host's /home/user/nginx.conf file into the container's config path. The image used is nginx.
Fill all three blanks to write a Docker Compose service for Nginx exposing port 80 and using a volume for config.
services:
web:
image: [1]
ports:
- "[2]:80"
volumes:
- [3]:/etc/nginx/nginx.confThis Docker Compose snippet runs the nginx image, maps host port 8080 to container port 80, and mounts the host config file /home/user/nginx.conf inside the container.