Skip to content

Commit

Permalink
buildah: restore exclusion of "FROM oci-archive:"
Browse files Browse the repository at this point in the history
Commit f12435b (Replace grep base images parsing with
dockerfile-json) accidentally reverted fdc3d9c
(buildah: Don't include oci-archive: FROM lines in BASE_IMAGES)

Original commit message:

    In certain cases, we might have a FROM line which is from an archive
    exported by a pevious build stage; when we are pre-pulling images
    for a hermetic build, skip these images.

    (Even if the oci-archive wasn't generated during the build, there's
    no point in pre-pulling a local URL.)

See #1158

Signed-off-by: Owen W. Taylor <[email protected]>
  • Loading branch information
owtaylor authored and chmeliik committed Sep 23, 2024
1 parent c746a25 commit a45fed0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ spec:
BASE_IMAGES=$(
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_path" |
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName'
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)'
)
BUILDAH_ARGS=()
Expand Down
2 changes: 1 addition & 1 deletion task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ spec:
BASE_IMAGES=$(
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_path" |
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName'
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)'
)
BUILDAH_ARGS=()
Expand Down
2 changes: 1 addition & 1 deletion task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ spec:
BASE_IMAGES=$(
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_path" |
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName'
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)'
)
BUILDAH_ARGS=()
Expand Down
2 changes: 1 addition & 1 deletion task/buildah/0.2/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ spec:
BASE_IMAGES=$(
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_path" |
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName'
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)'
)
BUILDAH_ARGS=()
Expand Down

0 comments on commit a45fed0

Please sign in to comment.