Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 243
A developer has created a new image to use in a Docker build and has added a tag for the image by using the command:
$ docker tag 84fe411926287 local/app:0.4
Which command must be executed next to build the Docker image using the tag?
Answer options
- A. $ docker build -p local/app:0.4
- B. $ docker run -t local/app:0.4
- C. $ docker run -p local/app:0.4
- D. $ docker build -t local/app:0.4
Correct answer: D
Explanation
The correct command to build the Docker image with the specified tag is $ docker build -t local/app:0.4. The other options are incorrect because -p is not a valid option for build and using run does not build an image; it executes a container instead.