Use munged semantic version for side-loaded docker tag
This commit is contained in:
@@ -278,9 +278,12 @@ function kube::release::create_docker_images_for_server() {
|
||||
kube::log::status "Starting Docker build for image: ${binary_name}"
|
||||
|
||||
(
|
||||
local md5_sum
|
||||
md5_sum=$(kube::release::md5 "${binary_dir}/${binary_name}")
|
||||
|
||||
# Docker tags cannot contain '+'
|
||||
local docker_tag="${KUBE_GIT_VERSION/+/_}"
|
||||
if [[ -z "${docker_tag}" ]]; then
|
||||
kube::log::error "git version information missing; cannot create Docker tag"
|
||||
return 1
|
||||
fi
|
||||
local docker_build_path="${binary_dir}/${binary_name}.dockerbuild"
|
||||
local docker_file_path="${docker_build_path}/Dockerfile"
|
||||
local binary_file_path="${binary_dir}/${binary_name}"
|
||||
@@ -292,15 +295,15 @@ function kube::release::create_docker_images_for_server() {
|
||||
|
||||
if [[ ${arch} == "amd64" ]]; then
|
||||
# If we are building a amd64 docker image, preserve the original image name
|
||||
local docker_image_tag=gcr.io/google_containers/${binary_name}:${md5_sum}
|
||||
local docker_image_tag="gcr.io/google_containers/${binary_name}:${docker_tag}"
|
||||
else
|
||||
# If we are building a docker image for another architecture, append the arch in the image tag
|
||||
local docker_image_tag=gcr.io/google_containers/${binary_name}-${arch}:${md5_sum}
|
||||
local docker_image_tag="gcr.io/google_containers/${binary_name}-${arch}:${docker_tag}"
|
||||
fi
|
||||
|
||||
"${DOCKER[@]}" build --pull -q -t "${docker_image_tag}" ${docker_build_path} >/dev/null
|
||||
"${DOCKER[@]}" save ${docker_image_tag} > ${binary_dir}/${binary_name}.tar
|
||||
echo $md5_sum > ${binary_dir}/${binary_name}.docker_tag
|
||||
echo "${docker_tag}" > ${binary_dir}/${binary_name}.docker_tag
|
||||
|
||||
rm -rf ${docker_build_path}
|
||||
|
||||
|
Reference in New Issue
Block a user