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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ