Skip to content

Commit 46c59e4

Browse files
authored
Merge pull request #8 from SloCompTech/develop
Added environment for armhf
2 parents 102a235 + c22d05d commit 46c59e4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

hooks/pre_build

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d '.' -f 3)
4+
5+
if [ -z "$BUILD_ARCH" ] || [ "$BUILD_ARCH" == "amd64" ]; then
6+
echo 'qemu-user-static: Registration not required for current arch';
7+
exit 0
8+
fi
9+
10+
#
11+
# DockerHub multiarch hack
12+
# @see https://stackoverflow.com/questions/54578066/how-to-build-a-docker-image-on-a-specific-architecture-with-docker-hub
13+
# @see https://stackoverflow.com/questions/55818831/dockerhub-automated-build-for-arm-arm64-permission-denied
14+
# @see https://stackoverflow.com/questions/44925788/dockerfile-compile-in-local-machine-but-fails-in-docker-hub-for-automated-build
15+
# @see https://github.com/cmosh/alpine-arm
16+
# @see https://github.com/balena-io-library/armv7hf-debian-qemu/tree/master/bin
17+
# @see https://wiki.debian.org/RaspberryPi/qemu-user-static
18+
# @see https://github.com/multiarch/qemu-user-static
19+
# @see https://aquarat.co.za/tag/dockerhub/
20+
#
21+
docker run --rm --privileged multiarch/qemu-user-static:register --reset

0 commit comments

Comments
 (0)