Challenge - 5 Problems
Nginx Docker Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Nginx container startup log
You run the command
docker run --name webserver -d nginx. What is the expected output of docker logs webserver?Attempts:
2 left
💡 Hint
Check the typical startup log messages for the official Nginx container.
✗ Incorrect
When the Nginx container starts successfully, it logs notices about the event method, version, and worker processes starting. Option B shows this typical log output. Option B shows image pull messages, not logs. Option B is an error if port 80 is busy. Option B is a shell error.
❓ Configuration
intermediate1:30remaining
Mounting custom Nginx config in Docker
You want to run the official Nginx Docker container with your own
nginx.conf file located at /home/user/nginx.conf. Which docker run command correctly mounts this config to override the default?Attempts:
2 left
💡 Hint
The official Nginx image expects the main config at /etc/nginx/nginx.conf.
✗ Incorrect
The official Nginx Docker image uses /etc/nginx/nginx.conf as the main config file. Mounting your custom config there overrides the default. Option D correctly mounts the file read-only. Option D reverses source and target. Option D uses a wrong path. Option D mounts to conf.d directory which expects snippets, not the main config.
❓ Troubleshoot
advanced1:30remaining
Nginx container fails to start with port binding error
You run
What is the most likely cause?
docker run -d -p 80:80 nginx but the container exits immediately. Checking logs shows:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)What is the most likely cause?
Attempts:
2 left
💡 Hint
Port binding errors usually mean the port is busy on the host machine.
✗ Incorrect
The error means the host port 80 is already occupied by another process, so Docker cannot bind it for the container. Option C would cause different errors. Option C is unlikely as containers run as root by default. Option C would prevent any Docker commands from working.
🔀 Workflow
advanced2:00remaining
Updating Nginx container with zero downtime
You have a running Nginx container named
webserver. You want to update it to a newer Nginx image version without downtime. Which workflow is best?Attempts:
2 left
💡 Hint
Zero downtime means traffic must not be interrupted during update.
✗ Incorrect
Option A describes a blue-green deployment approach: run new container on different ports, switch traffic, then stop old container. This avoids downtime. Options A and C cause downtime by stopping old container first. Option A is unrelated.
✅ Best Practice
expert2:00remaining
Securing Nginx Docker container with least privileges
Which practice best improves security by running the official Nginx Docker container with least privileges?
Attempts:
2 left
💡 Hint
Running as non-root inside containers is a common security best practice.
✗ Incorrect
Running Nginx as a non-root user inside the container reduces risk if compromised. Option A is insecure. Option A disables useful logs and does not improve privilege. Option A grants excessive privileges, increasing risk.