nerdexam
Microsoft

AZ-800 · Question #254

You have a Windows Server container host named Server1. You create a Dockerfile named df1. You need to generate a container image by using df1. Which command should you run?

The correct answer is A. docker build. 'docker build' is the command used to create (build) a container image from a Dockerfile. You specify the Dockerfile using the '-f' flag (e.g., 'docker build -f df1 .'), and Docker processes the instructions in the file to assemble the image layer by layer. The other commands…

Manage virtual machines and containers

Question

You have a Windows Server container host named Server1. You create a Dockerfile named df1. You need to generate a container image by using df1. Which command should you run?

Options

  • Adocker build
  • Bdocker exec
  • Cdocker create
  • Ddocker images

How the community answered

(58 responses)
  • A
    91% (53)
  • B
    2% (1)
  • C
    5% (3)
  • D
    2% (1)

Explanation

'docker build' is the command used to create (build) a container image from a Dockerfile. You specify the Dockerfile using the '-f' flag (e.g., 'docker build -f df1 .'), and Docker processes the instructions in the file to assemble the image layer by layer. The other commands serve different purposes: 'docker exec' runs a command inside an already-running container; 'docker create' creates a container from an existing image without starting it; 'docker images' lists locally stored images. None of these build an image from a Dockerfile.

Topics

#Docker#Container Images#Dockerfile#Windows Server Containers

Community Discussion

No community discussion yet for this question.

Full AZ-800 Practice