diff --git a/builder.sh b/builder.sh index 7b67196..b3e22c6 100755 --- a/builder.sh +++ b/builder.sh @@ -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 @@ -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}"