nerdexam
CompTIACompTIA

XK0-005 · Question #497

XK0-005 Question #497: Real Exam Question with Answer & Explanation

The correct answer is A: podman run -d -p 443:8443 httpd. The command that will accomplish the task of running a container with the httpd server inside and exposing it at port 443 of the Linux host machine while it internally listens on port 8443 is podman run -d -p 443:8443 httpd. This command uses the podman tool, which is a daemonles

Scripting, Containers, and Automation

Question

A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

Options

  • Apodman run -d -p 443:8443 httpd
  • Bpodman run -d -p 8443:443 httpd
  • Cpodman run -d -e 443:8443 httpd
  • Dpodman exec -p 8443:443 httpd

Explanation

The command that will accomplish the task of running a container with the httpd server inside and exposing it at port 443 of the Linux host machine while it internally listens on port 8443 is podman run -d -p 443:8443 httpd. This command uses the podman tool, which is a daemonless container engine that can run and manage containers on Linux systems. The -d option runs the container in detached mode, meaning that it runs in the background without blocking the terminal. The -p option maps a port on the host machine to a port inside the container, using the format host_port:container_port. In this case, port 443 on the host machine is mapped to port 8443 inside the container, allowing external access to the httpd server. The httpd argument specifies the name of the image to run as a container, which in this case is an image that contains the Apache HTTP Server software. The other options are not correct commands for accomplishing

Topics

#Podman#Container Networking#Port Mapping#Container Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions