CompTIA Linux+ (XK0-006) — Question 7

A Linux administrator needs to add an instruction into a Dockerfile so that the process /sbin/app-01 is executed when a new container starts. Which of the following accomplishes this task?

Answer options

Correct answer: B

Explanation

The correct answer is B, ENTRYPOINT, as it defines the command that will run when the container starts. A, FROM, is used to specify the base image; C, ONBUILD, triggers instructions when the image is used as a base for another build; and D, EXPOSE, is for documenting the ports that the container listens on, but does not execute a command.