Fix OS detection in custom-docker-build

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2022-07-05 11:13:47 +02:00
parent 0a603faec2
commit d3aafec77f
No known key found for this signature in database
GPG key ID: 4C514D15D07186F1

View file

@ -13,6 +13,16 @@ function get_base_image_reference() {
fi
}
function print_os_args() {
CUSTOM_BASE_IMAGE=get_base_image_reference "$1"
if [ -z "$CUSTOM_BASE_IMAGE" ]; then
CUSTOM_BASE_IMAGE="$CUSTOM_DOCKER_ARCH/debian:buster"
fi
printf -- "--build-arg CUSTOM_BASE_IMAGE=%s " "$CUSTOM_BASE_IMAGE"
}
function print_golang_args() {
declare -A GOLANG_DOWNLOAD_SHA256
@ -334,7 +344,7 @@ function parse_arguments() {
version="${!tool}"
case "$tool" in
ARCH) CUSTOM_DOCKER_ARCH=$version ;;
OS) CUSTOM_BASE_IMAGE=get_base_image_reference $version ;;
OS) print_os_args $version ;;
RUBY) print_ruby_args $version ;;
BUNDLER) print_bundler_args $version ;;
RUBYGEMS) print_rubygems_args $version ;;
@ -357,12 +367,6 @@ function parse_arguments() {
esac
fi
done
if [ -z "$CUSTOM_BASE_IMAGE" ]; then
CUSTOM_BASE_IMAGE="$CUSTOM_DOCKER_ARCH/debian:buster"
fi
printf -- "--build-arg CUSTOM_BASE_IMAGE=%s " "$CUSTOM_BASE_IMAGE"
}
function generate_command() {