From 9f6d63ea15ab70cabd7cdeaf3973099dd9eec55e Mon Sep 17 00:00:00 2001 From: Christos Manios Date: Wed, 9 Oct 2019 07:51:09 +0300 Subject: [PATCH] Add proper gosu according to architecture. (#6) --- hooks/post_checkout | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hooks/post_checkout b/hooks/post_checkout index a9724a4..a3f2e6b 100755 --- a/hooks/post_checkout +++ b/hooks/post_checkout @@ -37,6 +37,17 @@ echo "Image name: ${FROM_IMAGE_NAME}. Exporting it to ENV" if [ "${ARCHITECTURE}" == "arm" ]; then echo "Enabling qemu-arm-static in Dockerfile" sed -i 's/^# *\(COPY qemu-arm-static\)/\1/g' "${DOCKERFILE_PATH}" + + if [ "${ARC_VARIANT}" == "v6" ]; then + echo "Replacing the correct gosu binary link with gosu-armel (ARM v6)" + sed -i 's/gosu-amd64/gosu-armel/g' "${DOCKERFILE_PATH}" + else + echo "Replacing the correct gosu binary link with gosu-armhf (ARM v7)" + sed -i 's/gosu-amd64/gosu-armhf/g' "${DOCKERFILE_PATH}" + fi fi echo "export ALPINE_IMAGE_NAME=${FROM_IMAGE_NAME}" > imagevars.sh +echo "export ALPINE_ARCHITECTURE=${ARCHITECTURE}" >> imagevars.sh +echo "export ALPINE_ARC_VARIANT=${ARC_VARIANT}" >> imagevars.sh +echo "export REPO_BRANCH=${MY_BRANCH}" >> imagevars.sh