312-97 practice question 26 of 35
(Richard Branson has been working as a DevSecOps engineer in an IT company since the past 7 years. He has launched an application in a container one month ago. Recently, he modified the container and would like to commit the changes to a new image. Which of the following commands should Branson use to save the current state of the container as a new image?.)
Full set: 100 questionsThe docker commit command is used to create a new image from a container's changes. When a developer makes modifications inside a running container (e.g., installing software, modifying configuration files), this command captures the state of the container's filesystem and creates a new, persistent image from it. The new image can then be tagged and pushed to a registry. The basic syntax is docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]], which directly addresses the scenario of saving the current state of a modified container as a new image.
A. container commit: This is not a valid command. The Docker command-line interface (CLI) requires the docker executable to be specified first (e.g., docker commit).
B. docker push: This command is used to upload an already existing local image to a remote container registry, such as Docker Hub. It does not create a new image.
C. container push: This is not a valid command in the Docker CLI for the same reason that container commit is invalid.
1. Docker Official Documentation, docker commit command reference. The documentation explicitly states, "Create a new image from a container’s changes." It provides the syntax and usage examples for this specific purpose. (docs.docker.com/engine/reference/commandline/commit/, Description section).
2. "Docker: Up & Running, 2nd Edition" by Sean P. Kane and Karl Matthias (O'Reilly Media). Chapter 3, "Images," explains the docker commit command as a method to create a new image layer based on the changes made within a running container.
Keep practicing
Take the free 312-97 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 312-97 practice questions
- Question 1(Sandra Oliver joined SinClare Soft Pvt. Ltd. as a DevSecOps engineer in January of 2010.…
- Question 2(Robert Wheeler has been working as a DevSecOps engineer in an IT company for the past 5 …
- Question 3(Debra Aniston is a DevSecOps engineer in an IT company that develops software products a…
- Question 4(Craig Kelly has been working as a software development team leader in an IT company over…
- Question 5(Walter O’Brien recently joined as a junior DevSecOps engineer in an IT company located i…
- Question 6(SinCaire is a software development company that develops web applications for various cl…
