Courseiva
mediumMultiple ChoiceObjective-mapped

XK0-006 Practice Question: An administrator runs the commands shown in the…

Network Topology
$ docker inspect web1format='{{.NetworkSettings.IPAddress}}'Refer to the exhibit.$ docker ps172.17.0.2<!DOCTYPE html>listen 80 default_serverlisten [::]:80 default_server

An administrator runs the commands shown in the exhibit. The container is accessible via curl using the container IP. However, the administrator cannot access the web server using the host's IP address on port 80. What is the most likely cause?

⚠ Common exam trap

Many candidates assume a running container with a working service is automatically accessible on the host's IP, but Docker requires explicit port publishing to bridge the host network namespace to the container's network namespace.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The container's port 80 is not published to the host.

The administrator ran `docker run -d nginx` without the `-p` or `--publish` flag, which means port 80 inside the container is not mapped to any port on the host. The container is accessible via its own IP because Docker networking allows direct container-to-container communication, but the host's IP on port 80 remains unbound, so curl to the host IP fails. Publishing the port with `-p 80:80` would expose the container's port 80 on the host's interface.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The container's IP address is incorrect.

    Why it's wrong here

    The IP 172.17.0.2 is correct and accessible via curl.

  • The container's port 80 is not published to the host.

    Why this is correct

    No -p option was used; port is only accessible on the container's network.

  • Nginx is configured to listen on a different port.

    Why it's wrong here

    The exec command shows listen 80.

  • The container is not running.

    Why it's wrong here

    The STATUS shows 'Up 10 minutes', so it is running.

About these practice questions

One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.