Want to clarify my understanding as I am confused after studying the documentation
For command docker build -t the definition stated that
-t flag "Name and optionally a tag in the 'name:tag' format"
We then run docker tag xxx to "Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE" before we can push to the registry.
What is the difference of the functionality of 2 tagging here? Is the -t flag tags as the name of the build (image), which then docker tag that on top of the 'tagged' build before pushing it?
I tried searching online and questions here but couldn't find any explanation.
docker tagand the-tflag. The-tflag is just shorthand instead of building the image and runningdocker tagafterwards to tag the image id.docker build -t name:tag .==docker build . && docker tag <id_of_precedent_buid_written_on_screen> name:tagdocker build -tflag, we can skip the command stepdocker tag?hello-world). Then it tags it with a name in a remote registry (aws_account_id.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest). That allows you topushthe image to that registry.