Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for arch specifc dockerfiles #160

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
pvizeli marked this conversation as resolved.
Show resolved Hide resolved
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