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?
D.
build is used to build the image and -t is the option for tags.
run could also be used but it also starts the app and it does not say it needs to start
From my point of view the question is wrong, because it says that the image already exists and have a tag and after that is asking how you can build the image, but if the image exist and already have a tag I can conclude that it is already builded...
Any thought on this?
You are right. Again a terribly worded question.
"Which command must be executed next to build the Docker image using the tag?"
- none, it was already built and tagged
A better question would have been:
"Which command can be used to build and tag an image"
But even then answer D would not work, since the command
$ docker build -t local/app:0.4
is missing the "PATH | URL | - " part of the command.
https://docs.docker.com/engine/reference/commandline/run/
If you check the docker documentation, the option -t on the "docker run" command is related to "--tty" (Allocate a pseudo-TTY).
With this, if you check the following documentation, you can see that the -t option on the "docker build" command is related to the "--tag" (Name and optionally a tag in the name:tag format)
https://docs.docker.com/engine/reference/commandline/build/
upvoted 2 times
...
...
...
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
macxsz
Highly Voted 2 years, 5 months agortg2123
Most Recent 1 year, 9 months agortg2123
1 year, 9 months agoherrmann69
10 months agopetrus28
1 year, 8 months ago