After going through the code I found that the put-image
command actually adds an image to the repository. In the case of ECR by AWS this command is used by AWS to add metadata of the image uploaded via the docker push command.
# aws ecr put-image --repository-name test --region us-east-1 --image-manifest test --endpoint-url http://localhost:5000 --image-tag v1
{
"image": {
"registryId": "012345678910",
"repositoryName": "test",
"imageId": {
"imageDigest": "sha256:a6698ae96409579a4f8ac96f5e5f276467b3f62d184c9e6db537daeedb9dd939",
"imageTag": "v1"
},
"imageManifest": "test"
}
}
# aws ecr list-images --repository-name test --region us-east-1 --endpoint-url http://localhost:5000
{
"imageIds": [
{
"imageDigest": "i don't know",
"imageTag": "v1"
}
]
}
Luckily my code doesn't need to push or pull image from the ECR repo. This method might not work if that is the case.