Skip to content

Commit

Permalink
Fix i386 builds reporting x86_64 in the build process (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jan 3, 2024
1 parent 50262a6 commit 1f15d48
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}/")"
Expand Down Expand Up @@ -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}" \
Expand Down

0 comments on commit 1f15d48

Please sign in to comment.