nerdexam
CompTIA

XK0-005 · Question #649

A Linux administrator needs to rebuild a container with the httpd service in order to change some default parameters. Which of the following should be the first command line in the Dockerfile?

The correct answer is A. FROM httpd. Every Dockerfile must begin with a FROM instruction (with the only exception being ARG statements that precede FROM). The FROM instruction specifies the base image from which the new container image is built. 'FROM httpd' tells Docker to use the official Apache HTTP Server…

Scripting, Containers, and Automation

Question

A Linux administrator needs to rebuild a container with the httpd service in order to change some default parameters. Which of the following should be the first command line in the Dockerfile?

Options

  • AFROM httpd
  • BBASE httpd
  • CUSE httpd
  • DINHERIT httpd

How the community answered

(38 responses)
  • A
    95% (36)
  • B
    3% (1)
  • D
    3% (1)

Explanation

Every Dockerfile must begin with a FROM instruction (with the only exception being ARG statements that precede FROM). The FROM instruction specifies the base image from which the new container image is built. 'FROM httpd' tells Docker to use the official Apache HTTP Server image as the starting point. All subsequent instructions (RUN, COPY, ENV, EXPOSE, CMD, etc.) build upon this base. 'BASE' (B), 'USE' (C), and 'INHERIT' (D) are not valid Dockerfile instructions - they do not exist in the Dockerfile specification and would cause a build error.

Topics

#Dockerfile#Docker#Containers#Base Image

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice