Skip to content

Commit

Permalink
only try to enable loopback in hermetic mode
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwcook committed Oct 19, 2024
1 parent acc3be4 commit 2d8ab89
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion task/buildah/0.2/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ spec:
if [ "${HERMETIC}" == "true" ]; then
BUILDAH_ARGS+=("--pull=never")
UNSHARE_ARGS+=("--net")
for image in $BASE_IMAGES; do
unshare -Ufp --keep-caps -r --map-users 1,1,65536 --map-groups 1,1,65536 -- buildah pull $image
done
Expand Down Expand Up @@ -398,7 +399,12 @@ spec:
-f "$dockerfile_path" -t "$IMAGE" .
)
buildah_cmd=$(printf "%q " "${buildah_cmd_array[@]}")
command="ip link set lo up && $buildah_cmd"
if [ "${HERMETIC}" == "true" ]; then
command="ip link set lo up && $buildah_cmd"
else
command="$buildah_cmd"
fi
unshare -Uf "${UNSHARE_ARGS[@]}" --keep-caps -r --map-users 1,1,65536 --map-groups 1,1,65536 -w "${SOURCE_CODE_DIR}/$CONTEXT" -- sh -c "$command"
Expand Down

0 comments on commit 2d8ab89

Please sign in to comment.