View all questions & answers for the 200-901 exam
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?
$ docker build -p local/app:0.4
$ docker run -t local/app:0.4
$ docker run -p local/app:0.4
$ docker build -t local/app:0.4
The docker build command is used to build an image from a Dockerfile. The -t option tags the image with a specified name and tag.
Tagging: The docker tag command associates an image ID with a repository and tag.
Building with Tag: The correct command to build the Docker image and tag it as local/app:0.4 is docker build -t local/app:0.4.
Option D is the correct command to build and tag the image.
Submit