Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the action to work with DOCKER_BUILDKIT enabled #138

Closed
whoan opened this issue Oct 18, 2023 · 2 comments · Fixed by #141
Closed

Make the action to work with DOCKER_BUILDKIT enabled #138

whoan opened this issue Oct 18, 2023 · 2 comments · Fixed by #141

Comments

@whoan
Copy link
Owner

whoan commented Oct 18, 2023

Since docker in GitHub runners now use DOCKER_BUILDKIT by default, and this action currently relies in old docker build output, I disabled DOCKER_BUILDKIT in #135 but that broke the builds for some people.

The action needs to support DOCKER_BUILDKIT for those relying in such a behaviour, and because the legacy builder is deprecated:

DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
            environment-variable.
@whoan
Copy link
Owner Author

whoan commented Oct 18, 2023

As a workaround, I am thinking of saving the cache in a well known directory so adding an upload-artifact and a download-artifact action to our workflows, would make the action to work with DOCKER_BUILDKIT enabled.

Also, I was thinking of creating a new image with the layers of the cache (saved with --cache-to) and push that to a registry besides our image. Then the script would have to pull and cp the layers from that image and then import the cache (with --cache-from).

I also played a little trying to share cache between old and new docker builder but it was getting challenging.

Suggestions, comments, patience, support, and of course, pull requests, are very welcome.

@whoan
Copy link
Owner Author

whoan commented Oct 22, 2023

Ended up using BuldKit's cache backends: https://docs.docker.com/build/cache/backends/. See #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant