Skip to content

Commit

Permalink
Add support for arch specifc dockerfiles (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli authored Nov 24, 2022
1 parent 715a08d commit aa61197
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 @@ -220,6 +220,7 @@ function run_build() {
local cache_tag="latest"
local metadata
local release="${version}"
local dockerfile="${build_dir}/Dockerfile"

# Overwrites
if bashio::var.has_value "${DOCKER_HUB}"; then repository="${DOCKER_HUB@L}"; fi
Expand Down Expand Up @@ -292,13 +293,19 @@ function run_build() {
bashio::exit.nok "Invalid base image ${build_from}"
fi

# Arch specific Dockerfile
if bashio::fs.file_exists "${build_dir}/Dockerfile.${build_arch}"; then
dockerfile="${build_dir}/Dockerfile.${build_arch}"
fi

# Build image
bashio::log.info "Run build for ${repository}/${image}:${version} with platform ${docker_platform}"
docker buildx build --pull -t "${repository}/${image}:${version}" \
docker buildx build --pull --tag "${repository}/${image}:${version}" \
--platform "${docker_platform}" \
--build-arg "BUILD_FROM=${build_from}" \
--build-arg "BUILD_VERSION=${version}" \
--build-arg "BUILD_ARCH=${build_arch}" \
--file "${dockerfile}" \
"${docker_cli[@]}" \
"${build_dir}"

Expand Down

0 comments on commit aa61197

Please sign in to comment.