Dockerfile.aarch64/armhf update the crossbuild method
This commit is contained in:
16
hooks/post_checkout
Normal file
16
hooks/post_checkout
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d '.' -f2)
|
||||
|
||||
[ "${BUILD_ARCH}" == "Dockerfile" ] && \
|
||||
{ echo 'qemu-user-static: Download not required for this arch'; exit 0; }
|
||||
|
||||
TAGS_API="https://api.github.com/repos/multiarch/qemu-user-static/tags"
|
||||
URL="https://github.com/multiarch/qemu-user-static/releases/download"
|
||||
LATEST_TAG=$(curl -LSs $TAGS_API \
|
||||
| awk -F'"' '/name.*v[0-9]/ {print $4; exit}')
|
||||
STATIC_ARCH=$([ "${BUILD_ARCH}" == "armhf" ] && \
|
||||
echo "${BUILD_ARCH::-2}" || echo "${BUILD_ARCH}")
|
||||
|
||||
curl -LSs "${URL}/${LATEST_TAG}/x86_64_qemu-${STATIC_ARCH}-static.tar.gz" \
|
||||
| tar xzv
|
||||
8
hooks/pre_build
Normal file
8
hooks/pre_build
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d '.' -f2)
|
||||
|
||||
[ "${BUILD_ARCH}" == "Dockerfile" ] && \
|
||||
{ echo 'qemu-user-static: Registration not required for this arch';exit 0; }
|
||||
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
Reference in New Issue
Block a user