nerdexam
Docker

DCA · Question #79

Can this set of commands identify the published port(s) for a container? Solution: docker container inspect', 'docker port'

The correct answer is A. Yes. Both docker container inspect and docker port are effective commands for identifying the published port mappings of a Docker container.

Submitted by the_admin· Apr 18, 2026Networking

Question

Can this set of commands identify the published port(s) for a container? Solution: docker container inspect', 'docker port'

Options

  • AYes
  • BNo

How the community answered

(26 responses)
  • A
    85% (22)
  • B
    15% (4)

Why each option

Both `docker container inspect` and `docker port` are effective commands for identifying the published port mappings of a Docker container.

AYesCorrect

The `docker container inspect` command provides a comprehensive JSON output that includes the container's network settings and port bindings, making it suitable for finding published ports. Additionally, `docker port` is a specialized command designed to directly list all mapped ports for a given container, efficiently showing the container-to-host port mappings.

BNo

Both `docker container inspect` and `docker port` are fully capable and widely used commands for retrieving information about a container's published ports.

Concept tested: Identifying Docker container published ports

Source: https://docs.docker.com/engine/reference/commandline/container_inspect/

Topics

#Docker commands#Container networking#Port mapping#Container inspection

Community Discussion

No community discussion yet for this question.

Full DCA Practice