ECR / Pull-through-cache rule: how should I adapt my CI?

0

My (Gitlab)CI is building containers using Dockerfiles. To use Pull-Through-Cache rules with ECR, how should I modify it?

  1. Adapt the Dockerfile's FROM: statement? For instance from FROM:php:fpm to FROM:<aws_account_id>.dkr.ecr.<region>.amazonaws.com/library/php:fpm ?

But that's cumbersome (people who don't have ECR access can't build the Dockerfile)

  1. Or is there any other way (in Docker config?)
1 Respuesta
1
Respuesta aceptada

Unfortunately our implementation does not leverage the Docker config "registry-mirrors" feature. This means you currently can only use our ecr pull-through cache by updating the base image reference("FROM:...").

How often do you change your Dockerfile? Is it maybe a feasible approach to use a tool like "sed" in the CI/CD to overwrite the "FROM" Reference in the Docker File to the ecr pull-through cache address, so that GitLab CI uses the cache, but other Developers who build locally don't?

AWS
Bent
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 2 meses

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