Skip to content

Commit 9caf62e

Browse files
committed
fixes build trying to pull docker.io/yolean/homedir:root
but does this risk pulling previous build's nonroot instead of this build's root?
1 parent 2b211da commit 9caf62e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,12 @@ EOF
114114
if [ ! -z "$DEPENDENCIES" ]; then
115115
echo " build-contexts: |"
116116
for NAME_FULL in $DEPENDENCIES; do
117-
# Extract image name without tag
118-
local IMAGE_NAME=$(echo "$NAME_FULL" | cut -d':' -f1)
119-
echo " $IMAGE_NAME=docker-image://ghcr.io/$NAME_FULL"
117+
# Always map dependencies without the ':root' suffix in the build-context key
118+
local DEP_KEY="$NAME_FULL"
119+
if [[ "$DEP_KEY" == *:root ]]; then
120+
DEP_KEY="${DEP_KEY%:root}"
121+
fi
122+
echo " $DEP_KEY=docker-image://ghcr.io/$NAME_FULL"
120123
done
121124
fi
122125

to-nonroot/homedir/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$TARGETPLATFORM yolean/homedir:root
1+
FROM --platform=$TARGETPLATFORM yolean/homedir
22

33
# Appends the same nonroot directives as https://github.com/Yolean/kubernetes-kafka/tree/master/nonroot
44
# i.e. https://github.com/solsson/dockerfiles/tree/native/kafka-nonroot

0 commit comments

Comments
 (0)