Complete the Docker command to pull the official Nginx image from Docker Hub.
docker [1] nginxThe docker pull command downloads the official Nginx image from Docker Hub to your local machine.
Complete the Docker command to start a container named 'webserver' from the official Nginx image, mapping port 8080 on the host to port 80 in the container.
docker run -d --name webserver -p [1]:80 nginx
Port 8080 on the host is mapped to port 80 inside the container where Nginx listens.
Fix the error in the Dockerfile line to use the official Nginx image as base.
FROM [1]The correct syntax for the official Nginx image is nginx:latest. The colon separates the image name and tag.
Fill both blanks to create a Docker command that runs Nginx in detached mode and removes the container after it stops.
docker run [1] [2] nginx
-d runs the container in detached mode. --rm removes the container automatically after it stops.
Fill all three blanks to create a Docker command that runs Nginx, names the container 'mynginx', maps port 8081 on host to 80 in container, and mounts local directory '/home/user/site' to '/usr/share/nginx/html' inside container.
docker run -d --name [1] -p [2]:80 -v [3]:/usr/share/nginx/html nginx
The container is named 'mynginx'. Port 8081 on host maps to 80 in container. The local directory '/home/user/site' is mounted to serve content.