QuestionQ67

VerifiedDevSecOps Pipeline-Build and Test Stage

Richard Branson has been working as a DevSecOps engineer at an IT company for the past 7 years. A month ago, he launched an application inside a container. He has since modified the container and now wants to save these changes as a new image.

Which command should Branson use to commit the current state of the container as a new image?

Explanation

The docker commit command creates a new image from a container's changes, effectively capturing the current state of a container's filesystem (including any modifications made since it was started) and saving it as a new Docker image. This is the standard Docker CLI operation for this purpose, as documented in Docker's official reference. docker push is used to upload an existing image to a registry, not to create one from container changes, and container commit/container push are not valid Docker command syntax.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!