allow exporting to github cache backend#535
Conversation
74f47e8 to
6de12ae
Compare
|
Added caps detection so that depends on #565 |
Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Tonis Tiigi <[email protected]>
6de12ae to
d7964be
Compare
|
I've taken this out of draft. If the caps detection works and we are ok with the ux we can merge this and continue testing/updating the Buildkit PR. |
crazy-max
left a comment
There was a problem hiding this comment.
Ux is fine to me to start with. Thanks
|
Is there any way to use this with https://github.com/docker/setup-buildx-action yet? Or do we need to wait when Buildx is tagged? |
|
Are we waiting for Is it already working somehow name: Build
uses: docker/build-push-action@master
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha |
|
@JanJakes @douglasduteil We need the server-side first moby/buildkit/pull/1974
I was using a staging build to test the feature. |
|
Does anyone have a complete example of using this, are you still required to setup the cache in an action? |
|
Here's how I ended up caching of our "admin-api" Docker layers, on GitHub Actions: It adds and updates the resulting Docker image to the "Packages" section of our GitHub repository. Hope this helps. |
|
@adrienjoly this PR is about a new "GitHub native"cache backend being implemented that should be faster / better with regards to expiration etc. Caching to github package registry is kinda old school and slow in my experience. |
|
My bad, thanks for the clarification. |
|
Yeah, I was just looking to see the entire cache system in use in an example. @douglasduteil posted a piece of code from @crazy-max but the repo is no longer exists or is public. |
|
Will be available when moby/buildkit#1974 is merged. |
|
If anyone else is looking to give this a shot without having to build |
Thanks. Im getting: |
|
@patroza You can test the gha cache exporter using this workflow from the official Build Push Action while waiting for buildx 0.6 and BuildKit 0.9 to be GA. |
Changes: * https://github.com/docker/buildx/releases/tag/v0.6.0 * https://github.com/docker/buildx/releases/tag/v0.6.1 * https://github.com/docker/buildx/releases/tag/v0.6.2 * https://github.com/docker/buildx/releases/tag/v0.6.3 * https://github.com/docker/buildx/releases/tag/v0.7.0 Significantly, this introduces support for GHA caches, see docker/buildx#535 (this will require separate changes). Signed-off-by: Stephen Kitt <[email protected]>
Changes: * https://github.com/docker/buildx/releases/tag/v0.6.0 * https://github.com/docker/buildx/releases/tag/v0.6.1 * https://github.com/docker/buildx/releases/tag/v0.6.2 * https://github.com/docker/buildx/releases/tag/v0.6.3 * https://github.com/docker/buildx/releases/tag/v0.7.0 Significantly, this introduces support for GHA caches, see docker/buildx#535 (this will require separate changes). Signed-off-by: Stephen Kitt <[email protected]>
Client-side support for moby/buildkit#1974
--cache-to type=gha[,scope=foo]--cache-from type=gha[,scope=foo]If called outside github environment and required
envare not present then the configuration will be skipped. Token/URL can also be passed directly in csv but I would expect only a program wrapping buildx to use that method.Signed-off-by: Tonis Tiigi [email protected]