0
0
Nginxdevops~10 mins

Why containerized Nginx simplifies deployment - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start an Nginx container using Docker.

Nginx
docker run -d -p 80:80 [1]
Drag options to blanks, or click blank then click option'
Anode
Bapache
Cmysql
Dnginx
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong image name like apache or mysql.
Forgetting to map port 80.
2fill in blank
medium

Complete the command to remove a running Nginx container named 'webserver'.

Nginx
docker rm -f [1]
Drag options to blanks, or click blank then click option'
Awebserver
Bnginx
Ccontainer1
Dserver
Attempts:
3 left
💡 Hint
Common Mistakes
Using the image name instead of container name.
Using a generic name not matching the container.
3fill in blank
hard

Fix the error in the Dockerfile line to copy the Nginx config file.

Nginx
COPY [1] /etc/nginx/nginx.conf
Drag options to blanks, or click blank then click option'
Adefault.conf
Bconfig.yaml
Cnginx.conf
Dindex.html
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated files like index.html or config.yaml.
Using default.conf which is for site configs, not main config.
4fill in blank
hard

Fill both blanks to create a Docker command that runs Nginx with a custom config file from the host.

Nginx
docker run -d -p 8080:80 -v [1]:/etc/nginx/nginx.conf [2]
Drag options to blanks, or click blank then click option'
A/home/user/nginx.conf
Bnginx
C/etc/nginx/nginx.conf
Dapache
Attempts:
3 left
💡 Hint
Common Mistakes
Mounting the wrong file path.
Using the wrong image name like apache.
5fill in blank
hard

Fill all three blanks to write a Docker Compose service for Nginx exposing port 80 and using a volume for config.

Nginx
services:
  web:
    image: [1]
    ports:
      - "[2]:80"
    volumes:
      - [3]:/etc/nginx/nginx.conf
Drag options to blanks, or click blank then click option'
Anginx
B8080
C/home/user/nginx.conf
Dmysql
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong image names like mysql.
Incorrect port mapping.
Wrong volume paths.