ECR is not deleting images; how to force layer upload

3

After deleting ECR images, uploading a new version does not actually upload the version but instead I get all "layer already exists" messages. How do I actually delete the images so that I can force a fresh upload? The layers that "already exist" are NOT the same as the ones that I am trying to upload and I can't see any way to force the upload other than to delete all the images in the repository which doesn't work.

Thanks!

  • Hello, how are you uploading these images to ECR? From your local machine, CodeBuild, or somewhere else? Also, how are you deleting these images? Manually via the console, through the CLI, or another method? The more details you can provide, the better.

  • Over half a year and still no solution for this... Does AWS support ever read these?

  • I had to delete the image image and create another one with the same name to do so.

  • Any solution for this?

HooHost
preguntada hace 2 años2362 visualizaciones
1 Respuesta
-1

Its likely that the old image layers are not being re-built when you are building the image.

Prior to the docker build, try to force delete all of the depending image layers and see if it helps.

docker rmi -f <ImageID>
docker build -t <Image:Tag> . --no-cache
docker push <Image:Tag>

Also, it would help us understand the issue if you can provide more context like where and how you are building/deleting these images.

If the above steps do not work, please feel free to reach out to AWS Support for further troubleshooting.

profile pictureAWS
INGENIERO DE SOPORTE
respondido hace 2 años
  • I'm uploading using the CLI. I am deleting the image manually from the ECR web admin page. It shouldn't matter if I am trying to upload the exact same image, once I delete it it should be gone permanently, the very last thing that should happen is that AWS keeps an archived copy of our deleted image layers, especially the ones that are not public! This is undesirable on so many levels. When I try to upload the exact same image, it should need to be uploaded because no copy exists on AWS, period. It doesn't matter if I built an entirely new one, tagged it with something, or did nothing to it at all.

    What is actually happening: - I delete all the images from the ECR repository page. It is empty. Nothing is shown. Blank list. - I upload the image from my remote machine using the AWS CLI - AWS CLI on remote machine instantly spits out "layer already exists" for the 20 or so layers - Old deleted image is magically back on ECR.

    It is NOT uploading the same image again, it is 500MB and it would not be instant (in previous uploads it took several minutes). It is restoring it from a hidden trash folder or something, it still exists on AWS - this needs to be disabled permanently. We CANNOT have AWS storing/archiving deleted ECR images under any circumstances whatsoever. Perhaps there is an ECR setting to automatically archive instead of permanently deleting, that I don't know about?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas