LPIC-3 Exam 305 (Virtualization and Containerization) — Question 6
Which of the following statements in a Dockerfile leads to a container which outputs hello world? (Choose two.)
Answer options
- A. ENTRYPOINT "echo Hello World"
- B. ENTRYPOINT [ "echo hello world" ]
- C. ENTRYPOINT [ "echo", "hello", "world" ]
- D. ENTRYPOINT echo Hello World
- E. ENTRYPOINT "echo", "Hello", "World"
Correct answer: B, C
Explanation
The correct answers are B and C because they both use the correct syntax for the ENTRYPOINT instruction in a Dockerfile, allowing the container to execute the echo command properly. Option A is incorrect because it lacks the proper array syntax, while options D and E are also incorrect due to improper formatting of the ENTRYPOINT command.