nerdexam
Cisco

200-901 · Question #649

A development team needs to containerize an application named 'cust484705142'. A Dockerfile has been created and now the docker build command needs to be run using the current folder to find the…

The correct answer is A. docker build -t cust321453857-rep -f Dockerfile. The correct Docker build syntax to name a local repository and specify a Dockerfile is: docker build -t <repository-name> -f <Dockerfile>. The -t flag tags the resulting image with the local repository name, and -f Dockerfile explicitly names the file to use (found in the…

Application Deployment and Security

Question

A development team needs to containerize an application named 'cust484705142'. A Dockerfile has been created and now the docker build command needs to be run using the current folder to find the Dockerfile, build the image and create a local repository named 'cust321453857-rep' that points to that image. Which command must be used?

Options

  • Adocker build -t cust321453857-rep -f Dockerfile
  • Bdocker build cust321453857-rep -f Dockerfile.txt
  • Cdocker build cust321453857-rep Dockerfile
  • Ddocker build -t cust321453857-rep Dockerfile.txt

How the community answered

(41 responses)
  • A
    90% (37)
  • B
    2% (1)
  • C
    5% (2)
  • D
    2% (1)

Explanation

The correct Docker build syntax to name a local repository and specify a Dockerfile is: docker build -t <repository-name> -f <Dockerfile>. The -t flag tags the resulting image with the local repository name, and -f Dockerfile explicitly names the file to use (found in the current folder). Answer B has no -t flag and uses a wrong filename. Answer C has incorrect syntax with no flags. Answer D uses the wrong filename Dockerfile.txt instead of Dockerfile.

Topics

#Docker#Dockerfile#Image Build#Containerization

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice