One solution to this problem is to push to on main ECR repo first, and then to spread that image to the rest of the ECR repos that it needs to go to. To accomplish this in one pipeline, you would:
- define all the image resources in one pipeline.
- arbitrarily pick the the “main” repo to build and push to
- define the job in such a way that the “secondary” repos come after the main one in the build plan
- when you define those secondary
put steps, add the
cache_from parameter to the definition. This will make docker load the image first before attempting to build it. This should skip the compile stage and simply push the image into the repo
An example of this is kind of job plan is below.
- name: build-multiple-images
- get: image-git
- get: image-version
- put: main-image
save: true # NOTE: this will save the image resource
- put: secondary-image
- main-image # NOTE: this will used saved image on disk