I have an existing image inside an ECR repo with the tag "780" and I wanted to make a copy of it inside the same repo with the tag "781". I tried executing the below commands which I found from here but that gives a new tag to the same image when given the same repo.
docker login REPO
docker pull REPO/IMAGE:TAG
docker tag REPO/IMAGE:TAG REPO/IMAGE:NEWTAG
docker push REPO/IMAGE:NEWTAG
Is there an API or utility (preferably in python) or any other way using which this can be achieved?
It's not possible to have two Docker images in the same repo with the same SHA256 hash. The Docker repository is saving space by detecting that they are the same image, so it is simply adding the tags to the image that already exists in the repo. This is working as intended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With