test images: Adds image labels by default

Adds the "image_version", "commit_id", "git_url" to the image labels.
This commit is contained in:
Claudiu Belu 2021-07-16 15:29:46 +00:00
parent f6c2068623
commit 05cfbecab9
14 changed files with 4 additions and 22 deletions

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="1.29-1"

View File

@ -92,5 +92,4 @@ ENV PATH="C:\dig\;C:\bin;C:\curl;C:\Windows\System32;C:\Windows;C:\Program Files
# Persist %PSCORE% ENV variable for user convenience
PSCORE="C:\Program Files\PowerShell\pwsh.exe"
LABEL image_version="1.29-1"
ENTRYPOINT ["cmd.exe", "/s", "/c"]

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="v1.0"

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="2.4.39-1"

View File

@ -43,5 +43,4 @@ ENV PATH="C:\dig;C:\bin;C:\curl;C:\Windows\System32;C:\Windows;C:\Program Files\
USER ContainerAdministrator
EXPOSE 80
LABEL image_version="2.4.39-1"
ENTRYPOINT ["C:/usr/local/apache2/bin/httpd.exe"]

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="2.4.38-1"

View File

@ -43,5 +43,4 @@ ENV PATH="C:\dig;C:\bin;C:\curl;C:\Windows\System32;C:\Windows;C:\Program Files\
USER ContainerAdministrator
EXPOSE 80
LABEL image_version="2.4.39-1"
ENTRYPOINT ["C:/usr/local/apache2/bin/httpd.exe"]

View File

@ -36,6 +36,7 @@ source "${KUBE_ROOT}/hack/lib/util.sh"
# Mapping of go ARCH to actual architectures shipped part of multiarch/qemu-user-static project
declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" )
GIT_COMMIT_ID=$(git log -1 --format=%h)
windows_os_versions=(1809 1903 1909 2004 20H2)
declare -A WINDOWS_OS_VERSIONS_MAP
@ -182,7 +183,9 @@ build() {
docker buildx build --progress=plain --no-cache --pull --output=type="${output_type}" --platform "${os_name}/${arch}" \
--build-arg BASEIMAGE="${base_image}" --build-arg REGISTRY="${REGISTRY}" --build-arg OS_VERSION="${os_version}" \
-t "${REGISTRY}/${image}:${TAG}-${suffix}" -f "${dockerfile_name}" .
-t "${REGISTRY}/${image}:${TAG}-${suffix}" -f "${dockerfile_name}" \
--label "image_version=${TAG}" --label "commit_id=${GIT_COMMIT_ID}" \
--label "git_url=https://github.com/kubernetes/kubernetes/tree/${GIT_COMMIT_ID}/test/images/${img_folder}" .
popd
done

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="1.15-1"

View File

@ -24,5 +24,4 @@ COPY --from=nginx-source /nginx /usr/share/nginx
USER ContainerAdministrator
EXPOSE 80
LABEL image_version="1.15-1"
ENTRYPOINT ["/bin/sh", "-c", " cd /usr/share/nginx && ./nginx.exe"]

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="1.14-1"

View File

@ -24,5 +24,4 @@ COPY --from=nginx-source /nginx /usr/share/nginx
USER ContainerAdministrator
EXPOSE 80
LABEL image_version="1.14-1"
ENTRYPOINT ["/bin/sh", "-c", " cd /usr/share/nginx && ./nginx.exe"]

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="5.26"

View File

@ -15,5 +15,3 @@
# NOTE(claudiub): Noop. We're just mirroring the image to staging.
ARG BASEIMAGE
FROM $BASEIMAGE
LABEL image_version="v1"