nerdexam
Microsoft

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.

Manage virtual machines and containers

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)
  • A
    4% (2)
  • B
    2% (1)
  • D
    94% (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.

Adocker image

The docker image command is used to manage existing Docker images (e.g., list, remove), not to create new ones from a Dockerfile.

Bdocker create

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.

Cdocker abort

The docker abort command does not exist in standard Docker CLI; there might be docker container stop or similar commands for stopping running processes.

Ddocker buildCorrect

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

#Docker#Dockerfile#Container images#docker build

Community Discussion

No community discussion yet for this question.

Full AZ-800 Practice