From a76b9dfc9618fb9826ac390bd39bc6a44c4d9cfb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 2 Jan 2024 18:10:48 -1000 Subject: [PATCH] Fix i386 builds reporting x86_64 in the build process --- builder.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/builder.sh b/builder.sh index 33ab45b..712e211 100755 --- a/builder.sh +++ b/builder.sh @@ -227,6 +227,7 @@ function run_build() { local cosign_base_issuer= local cosign_identity= local cosign_issuer= + local docker_wrapper="" # Overwrites if bashio::var.has_value "${DOCKER_HUB}"; then repository="${DOCKER_HUB@L}"; fi @@ -260,6 +261,12 @@ function run_build() { docker_cli+=("--build-arg" "QEMU_CPU=arm1176") fi + # Ensure docker reports correct architecture + # to the containerized build process + if bashio::var.equals "${build_arch}" i386; then + docker_wrapper="linux32" + fi + # Check if image exists on docker hub if bashio::var.true "$DOCKER_HUB_CHECK"; then metadata="$(curl -s "https://hub.docker.com/v2/repositories/${repository}/${image}/tags/${version}/")" @@ -314,7 +321,7 @@ function run_build() { # Build image bashio::log.info "Run build for ${repository}/${image}:${version} with platform ${docker_platform}" - docker buildx build --pull --tag "${repository}/${image}:${version}" \ + ${docker_wrapper} docker buildx build --pull --tag "${repository}/${image}:${version}" \ --platform "${docker_platform}" \ --build-arg "BUILD_FROM=${build_from}" \ --build-arg "BUILD_VERSION=${version}" \