AZ-800 · Question #97
You are the system administrator in the Cosco company. Your manager has asked you to create a new image. To achieve this, you created a Dockerfile and saved it to the disk. The next step would be to…
The correct answer is D. docker build. After creating a Dockerfile, the docker build command is used to process the instructions within it and create a new Docker image.
Question
You are the system administrator in the Cosco company. Your manager has asked you to create a new image. To achieve this, you created a Dockerfile and saved it to the disk. The next step would be to run the _________ command to create the new images.
Options
- Adocker image
- Bdocker create
- Cdocker abort
- Ddocker build
How the community answered
(50 responses)- A4% (2)
- B2% (1)
- D94% (47)
Why each option
After creating a Dockerfile, the docker build command is used to process the instructions within it and create a new Docker image.
The docker image command is used to manage existing Docker images (e.g., list, remove), not to create new ones from a Dockerfile.
The docker create command creates a new container from an image but does not start it, and it is not used to build an image from a Dockerfile.
The docker abort command does not exist in standard Docker CLI; there might be docker container stop or similar commands for stopping running processes.
The docker build command reads the instructions from a Dockerfile and executes them sequentially to create a new Docker image. This command is essential for turning a Dockerfile into a usable container image.
Concept tested: Docker image creation from Dockerfile
Source: https://docs.docker.com/engine/reference/commandline/build/
Topics
Community Discussion
No community discussion yet for this question.