This PR fixes an issue where only the latest image cache was available.
For other minor improvements, see the individual commit messages.
This PR fixes an issue where only the latest image cache was available.
For other minor improvements, see the individual commit messages.
Relevant docs: https://docs.docker.com/build/cache/backends/gha/
19 | id: main_builder
20 | continue-on-error: true
21 | with:
22 | context: .
23 | file: ${{ inputs.dockerfile }}
24 | - tags: ${{ inputs.tag }}
Even after looking at the docs, I'm not sure what the tags parameter is actually supposed to do. Did you figure this out?
It's meant to be used when exporting a built image to a registry.
22 | context: .
23 | file: ${{ inputs.dockerfile }}
24 | - tags: ${{ inputs.tag }}
25 | load: true
26 | - cache-from: type=gha
27 | + cache-from: type=gha,scope=${{ runner.arch }}
Would it be a good idea to add {{input.tag}} here (and maybe rename tag to scope)?
I don't think so. Tags are not used for caching.
I think we're talking past each other. (But sorry, my message was very unclear.) My suggestion is to add an input parameter to the run-in-docker-action that is used as a prefix to scope, i.e., the caller sets the scope.
In our case, the caller could then set scope=ci-image-${{ runner.arch }} or something like this.
I see. Reworked.
2 | @@ -3,10 +3,8 @@ description: 'Run a command in a Docker container, while passing explicitly set 3 | inputs: 4 | dockerfile: 5 | description: 'A Dockerfile that defines an image' 6 | - required: true 7 | - tag: 8 | - description: 'A tag of an image' 9 | - required: true 10 | + required: false 11 | + default: ./ci/linux-debian.Dockerfile
I'm not sure if this is a reasonable default. I mean, yes, this is what we always use. But currently, this action is not specific to libsecp256k1 at all, and I think it would be nice to keep it that way.
It seems unlikely that this action would be reused elsewhere.
The controversial commit has been dropped.
It seems unlikely that this action would be reused elsewhere.
True, but I think it's still a good idea to drop the default. It simply decreases coupling.
0 | @@ -1,5 +1,7 @@ 1 | FROM debian:stable-slim 2 | 3 | +ENV DEBIAN_FRONTEND=noninteractive
I think this is not a good idea because the Dockerfile can also be used interactively on a developer's machine. See https://serverfault.com/a/797318
Thanks! Reworked.
This change fixes an issue where only the latest image cache was
available.
The `tags` input is unused for caching.
See https://github.com/docker/build-push-action/releases.
This suppresses `debconf: unable to initialize frontend: ...` warnings.
Thank you for the review! Your feedback has been addressed.
utACK f163c35897db9a4adc2a5b37926942817a4fdeb7