Reputation: 971
I am running a script to build a Docker image. I need to push this image to 2 different repositories with different tags. For which I need to capture and store the build ID of the image. Docker build documentation talks about a way to store it in a file using --iidfile.
Do we have any examples around the same? Thank you.
Upvotes: 3
Views: 3634
Reputation: 28716
Actually, you don't need image ID. Just use docker tag
existing image in your build pipeline to create other "cloned" images. Example:
docker build -t repo1/image:tag1 .
docker tag repo1/image:tag1 repo2/image:tag2
docker push repo1/image:tag1
docker push repo2/image:tag2
Upvotes: 0