mirror of
https://code.thetadev.de/actions/kaniko.git
synced 2026-04-28 18:31:44 +00:00
small fixes
This commit is contained in:
@@ -40,7 +40,7 @@ inputs:
|
|||||||
description: "Prefix to be stripped from the tag"
|
description: "Prefix to be stripped from the tag"
|
||||||
required: false
|
required: false
|
||||||
platforms:
|
platforms:
|
||||||
description: "Target platforms to build (separated by comma)"
|
description: "Target platforms to build (separated by comma); Example: linux/amd64,linux/arm64"
|
||||||
required: false
|
required: false
|
||||||
extra_args:
|
extra_args:
|
||||||
description: "Additional arguments to be passed to the kaniko executor"
|
description: "Additional arguments to be passed to the kaniko executor"
|
||||||
|
|||||||
@@ -87,13 +87,15 @@ runKaniko() {
|
|||||||
# https://github.com/GoogleContainerTools/kaniko/issues/1349
|
# https://github.com/GoogleContainerTools/kaniko/issues/1349
|
||||||
IFS=''
|
IFS=''
|
||||||
kaniko_cmd="executor ${1} --reproducible --force"
|
kaniko_cmd="executor ${1} --reproducible --force"
|
||||||
echo "Running kaniko command ${kaniko_cmd}"
|
echo "Running kaniko command: ${kaniko_cmd}"
|
||||||
eval "${kaniko_cmd}"
|
eval "${kaniko_cmd}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n "$PLATFORMS" ]; then
|
if [ -n "$INPUT_PLATFORMS" ]; then
|
||||||
# Build image for all platforms, then push the manifest
|
# Build image for all platforms, then push the manifest
|
||||||
platformArray=$(echo "$PLATFORMS" | sed 's/,/ /g' )
|
platformArray=$(echo "$INPUT_PLATFORMS" | sed 's/,/ /g' )
|
||||||
|
echo "Building for the following platforms: $platformArray"
|
||||||
|
|
||||||
for platform in $platformArray; do
|
for platform in $platformArray; do
|
||||||
platformFn=$(echo "$platform" | sed 's#/#-#g')
|
platformFn=$(echo "$platform" | sed 's#/#-#g')
|
||||||
|
|
||||||
@@ -117,7 +119,7 @@ if [ -n "$PLATFORMS" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
manifest_cmd="crane index append $TAGS $DIGESTS"
|
manifest_cmd="crane index append $TAGS $DIGESTS"
|
||||||
echo "Running crane command ${manifest_cmd}"
|
echo "Running crane command: ${manifest_cmd}"
|
||||||
IMAGE_TAG_DIGEST=$(eval "$manifest_cmd")
|
IMAGE_TAG_DIGEST=$(eval "$manifest_cmd")
|
||||||
else
|
else
|
||||||
# Build and push image for the default platform
|
# Build and push image for the default platform
|
||||||
@@ -134,6 +136,6 @@ fi
|
|||||||
DIGEST=$(echo "$IMAGE_TAG_DIGEST" | cut -f2 -d '@')
|
DIGEST=$(echo "$IMAGE_TAG_DIGEST" | cut -f2 -d '@')
|
||||||
echo "image=$IMAGE" >> "$GITHUB_OUTPUT"
|
echo "image=$IMAGE" >> "$GITHUB_OUTPUT"
|
||||||
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"
|
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"
|
||||||
echo "image-tag-digest=IMAGE_TAG_DIGEST" >> "$GITHUB_OUTPUT"
|
echo "image-tag-digest=$IMAGE_TAG_DIGEST" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
echo "🎉 Successfully built $IMAGE_TAG_DIGEST"
|
echo "🎉 Successfully built $IMAGE_TAG_DIGEST"
|
||||||
|
|||||||
Reference in New Issue
Block a user