Skip to content

Commit

Permalink
Merge pull request #140 from whoan/issue-139
Browse files Browse the repository at this point in the history
Allow overriding DOCKER_BUILDKIT env var
  • Loading branch information
whoan authored Oct 19, 2023
2 parents 3c6917f + 4a7761a commit a15bd94
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ Built-in support for the most known registries:
- GitHub's (old and new registry)
- Google Cloud's

## :exclamation: New behavior if you force `DOCKER_BUILDKIT=1`

> It only affects multi-stage builds
This action relies on old builder output where we could take the hash of each intermediate layer during build and tag it as an image.
When new builder is enabled (`DOCKER_BUILDKIT=1`), this action is not able to push the layers of intermediate stages as it can NOT parse the builder output.
As a workaround, the action now forces `DOCKER_BUILDKIT=0` by default, but if your workflow relies on the new builder, at the temporary price of not using caches for all the stages, you can enable `DOCKER_BUILDKIT` like this in your job step:

- name: Build with DOCKER_BUILDKIT enabled
env:
DOCKER_BUILDKIT: 1
uses: whoan/docker-build-with-cache-action@issue-139
...

For plans to be able to cache all stages with `DOCKER_BUILDKIT=1`, see #138.

## Inputs

### Required
Expand Down
2 changes: 1 addition & 1 deletion docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

export DOCKER_BUILDKIT=0
set -e
export DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-0}

# helper functions
_has_value() {
Expand Down
1 change: 0 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

export DOCKER_BUILDKIT=0
set -e

_build_image() {
Expand Down

0 comments on commit a15bd94

Please sign in to comment.