0
0
Nginxdevops~20 mins

Why containerized Nginx simplifies deployment - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Containerized Nginx Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why does containerized Nginx simplify deployment?

Which of the following best explains why using a containerized Nginx server makes deployment easier?

AIt forces developers to configure Nginx differently for each environment.
BIt requires manual installation of Nginx on every server before deployment.
CIt packages Nginx with all its dependencies, ensuring consistent behavior across environments.
DIt increases the size of the application, making deployment slower.
Attempts:
2 left
💡 Hint

Think about how containers include everything needed to run an app.

💻 Command Output
intermediate
1:00remaining
Output of running Nginx container status command

What is the output of the command docker ps --filter "ancestor=nginx" --format "{{.Status}}" right after starting an Nginx container?

AUp 5 seconds
BExited (0) 5 seconds ago
CCreated
DError: No such container
Attempts:
2 left
💡 Hint

Think about what status a running container shows.

Configuration
advanced
2:30remaining
Correct Dockerfile snippet for containerized Nginx

Which Dockerfile snippet correctly sets up a containerized Nginx server serving static files from /usr/share/nginx/html?

A
FROM nginx
RUN apt-get install nginx
COPY ./static-html /var/www/html
EXPOSE 8080
B
FROM nginx:latest
COPY ./static-html /usr/share/nginx/html
EXPOSE 80
C
FROM ubuntu
COPY ./static-html /usr/share/nginx/html
CMD ["nginx"]
D
FROM nginx:alpine
COPY ./static-html /etc/nginx/html
EXPOSE 443
Attempts:
2 left
💡 Hint

Look for the official Nginx image and correct file paths.

🔀 Workflow
advanced
2:00remaining
Order of steps to deploy containerized Nginx

Arrange the steps in the correct order to deploy a containerized Nginx server serving your website.

A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,2,1,4
Attempts:
2 left
💡 Hint

Think about preparing files before building and running the container.

Troubleshoot
expert
3:00remaining
Diagnosing Nginx container port binding failure

You try to run an Nginx container with docker run -p 80:80 nginx but get an error that port 80 is already in use. What is the best way to fix this?

ARun the container without the <code>-p</code> option.
BChange the Nginx configuration inside the container to use port 8080.
CRebuild the Nginx image with a different base image.
DStop the process using port 80 or use a different host port mapping.
Attempts:
2 left
💡 Hint

Think about what causes port conflicts on the host machine.