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개 답변
1
수락된 답변

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
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠