GitHub Actions support for Docker BuildKit?

Hello - I’m wondering if it’s possible to use the new Docker BuildKit feature on GitHub Actions?  [BuildKit makes most builds faster and improves caching significantly.]

I tell Docker to use BuildKit locally by running:

$ DOCKER_BUILDKIT=1 docker build ...

but I don’t see a way to provide this or as an environment variable at build time on GitHub Actions.

I found a page in the Actions docs for the runtime environment, but did not see an analogous page for the build environment.

Thank you,
Taylor

2 Likes

If you want full control over how your Docker image is built, you can use a Docker image stored in a public registry using either of the docker:// specifier forms in the uses field of your Action block.

Let us know if you have more questions.

2 Likes

Thank you, @lee-dohm.  Do you know if support for BuildKit within Actions is on the roadmap?  I have been trying the new GitHub Package Registry Beta too, so it would be nice to use BuildKit with GitHub Actions + the GitHub Docker registry together.

[For my use case it is largely about how much faster BuildKit is for large / complex images vs building without it.]

Here you go:

https://github.com/marketplace/actions/docker-buildx

I am also looking for BuildKit support

docker builds with GitHub Actions failing for my case … 

https://github.com/xmlking/micro-starter-kit/blob/develop/Makefile#L170

BuildKit is supported ref https://github.com/docker/github-actions/issues/12#issuecomment-600540752