-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SAVE IMAGE --without-earthly-labels (#4084)
This commit adds the `--without-earthly-labels` for the SAVE IMAGE instruction to not modify the digest of the final artifact if none of its contents changes. Enabled `--allow-without-earthly-labels` feature. Certain custom registries may require strict checking of the image contents, so this option disables build information. --------- Co-authored-by: Alex Couture-Beil <[email protected]>
- Loading branch information
Showing
6 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Test for --without-earthly-labels feature | ||
VERSION --allow-without-earthly-labels 0.8 | ||
|
||
ARG --global DIND_IMAGE="earthly/dind:ubuntu-23.04-docker-25.0.2-1" | ||
|
||
all: | ||
BUILD +test-without-labels | ||
BUILD +test-with-labels | ||
|
||
myimage-without-labels: | ||
FROM alpine | ||
COPY file / | ||
SAVE IMAGE --without-earthly-labels myimage:test | ||
|
||
myimage-with-labels: | ||
FROM alpine | ||
COPY file / | ||
SAVE IMAGE myimage:test | ||
|
||
test-without-labels: | ||
FROM $DIND_IMAGE | ||
WITH DOCKER --load=+myimage-without-labels | ||
RUN docker inspect myimage:test | jq -r '.[].Config.Labels' | grep -q null | ||
END | ||
|
||
test-with-labels: | ||
FROM $DIND_IMAGE | ||
WITH DOCKER --load=+myimage-with-labels | ||
# We just test that fields aren't null. | ||
RUN docker inspect myimage:test | jq -e '.[].Config.Labels' > /dev/null | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Almost empty file |