Skip to content

Commit ad8772f

Browse files
committed
Use 'buildcache' for docker image build cache
Instead of re-purposing 'latest' tag, use 'buildcache' tag. Since we deploy with linux/amd64, make that explicit as well. The cache-from and cache-to which we now use with label/tag buildcache as I understand it makes a docker build faster by avoiding pulling the base image every time. In other words, I think GitHub's Container Registry will have our previous image layers locally, and whenever the first few layers are identical (majority case), it will be much faster to re-use them. The reason to use a separate tag for buildcache is that apparently it is not a pullable/usable artifact with docker pull. The reason to keep the latest tag is convenience for a one-off or exploratory pull. Issue #39 no matching manifest for linux/amd64 on docker pull ...:latest
1 parent 62920b0 commit ad8772f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ jobs:
3838
uses: docker/build-push-action@v3
3939
with:
4040
context: .
41+
platforms: linux/amd64
4142
push: true
4243
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
43-
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
44-
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,mode=max
44+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
45+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
4546
- name: Notify the top-level 'deploy' project that an image was pushed
4647
uses: aurelien-baudet/workflow-dispatch@v2.1.1
4748
with:

0 commit comments

Comments
 (0)