Services and User Management

A Dockerfile and its application files are in the current directory of a Linux server. An administrator must build an image from them and name it webapp with the tag 2.1. Which command does this?

Show the answer

Correct answerB. docker build -t webapp:2.1 .

docker build reads the Dockerfile in the context directory (the trailing dot) and -t assigns the name and tag. The -f option is tempting but selects an alternate Dockerfile path, not the image name.