A developer reports that a container running a custom web application is failing to start on a Red Hat Enterprise Linux 8 host. The container image is built from a Dockerfile that uses 'EXPOSE 8080'. The host firewall is enabled. Which action is most likely required to allow external access to the application?
Trap 1: Open port 8080 in the host firewall using firewall-cmd.
Opening the host firewall port alone does not make the container port accessible; the container port must be published.
Trap 2: Disable the host firewall to allow all incoming traffic.
Disabling the firewall is overly permissive and not a recommended practice.
Trap 3: Ensure the container image includes an EXPOSE instruction for port…
EXPOSE is only documentation; it does not publish the port.
- A
Start the container with the '-p 8080:8080' option to publish the port.
Publishing the container port with '-p' makes it accessible through the host.
- B
Open port 8080 in the host firewall using firewall-cmd.
Why wrong: Opening the host firewall port alone does not make the container port accessible; the container port must be published.
- C
Disable the host firewall to allow all incoming traffic.
Why wrong: Disabling the firewall is overly permissive and not a recommended practice.
- D
Ensure the container image includes an EXPOSE instruction for port 8080.
Why wrong: EXPOSE is only documentation; it does not publish the port.