Skip to content

Commit a15bd94

Browse files
authored
Merge pull request #140 from whoan/issue-139
Allow overriding DOCKER_BUILDKIT env var
2 parents 3c6917f + 4a7761a commit a15bd94

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ Built-in support for the most known registries:
1616
- GitHub's (old and new registry)
1717
- Google Cloud's
1818

19+
## :exclamation: New behavior if you force `DOCKER_BUILDKIT=1`
20+
21+
> It only affects multi-stage builds
22+
23+
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.
24+
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.
25+
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:
26+
27+
- name: Build with DOCKER_BUILDKIT enabled
28+
env:
29+
DOCKER_BUILDKIT: 1
30+
uses: whoan/docker-build-with-cache-action@issue-139
31+
...
32+
33+
For plans to be able to cache all stages with `DOCKER_BUILDKIT=1`, see #138.
34+
1935
## Inputs
2036

2137
### Required

docker-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
export DOCKER_BUILDKIT=0
43
set -e
4+
export DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-0}
55

66
# helper functions
77
_has_value() {

entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
22

3-
export DOCKER_BUILDKIT=0
43
set -e
54

65
_build_image() {

0 commit comments

Comments
 (0)