File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 11# Base image to use at runtime
2- ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2024-04-01-1711929684.2
2+ ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot
33
44# Golang image to use for compiling the manager
55ARG builder_image=public.ecr.aws/docker/library/golang
66
77# Version of Golang
88ARG golang_version
9+ # Version of eks-distro
10+ ARG eks_distro_version
911
1012# Build the manager binary
1113FROM $builder_image:$golang_version as builder
@@ -49,7 +51,7 @@ RUN GIT_VERSION=$service_controller_git_version && \
4951 -X ${VERSION_PKG}.BuildDate=${BUILD_DATE}" \
5052 -a -o $work_dir/bin/controller $work_dir/cmd/controller/main.go
5153
52- FROM $base_image
54+ FROM $base_image:$eks_distro_version
5355ARG base_image
5456LABEL org.opencontainers.image.base.name=$base_image
5557ARG service_alias
Original file line number Diff line number Diff line change 11# Base image to use at runtime
2- ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2023-09-06-1694026927.2
2+ ARG base_image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot
33
44# Golang image to use for compiling the manager
55ARG builder_image=public.ecr.aws/docker/library/golang
66
77# Version of Golang
88ARG golang_version
99
10+ # Version of eks-distro
11+ ARG eks_distro_version
12+
1013# Build the manager binary
1114FROM $builder_image:$golang_version as builder
1215
@@ -68,7 +71,7 @@ RUN GIT_VERSION=$service_controller_git_version && \
6871 -X ${VERSION_PKG}.BuildDate=${BUILD_DATE}" \
6972 -a -o $work_dir/bin/controller $work_dir/cmd/controller/main.go
7073
71- FROM $base_image
74+ FROM $base_image:$eks_distro_version
7275ARG base_image
7376LABEL org.opencontainers.image.base.name=$base_image
7477ARG service_alias
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ set -eo pipefail
55DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
66SCRIPTS_DIR=$DIR
77ROOT_DIR=$DIR /..
8+ TEST_INFRA_DIR=$ROOT_DIR /../test-infra
89DOCKERFILE_PATH=$ROOT_DIR /Dockerfile
910ACK_DIR=$ROOT_DIR /..
1011DOCKERFILE=${DOCKERFILE:- " $DOCKERFILE_PATH " }
@@ -88,9 +89,10 @@ if ! is_public_ecr_logged_in; then
8889 aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
8990fi
9091
91- pushd " $ROOT_DIR " 1> /dev/null
92- # Get the golang version from the code-generator
93- GOLANG_VERSION=${GOLANG_VERSION:- " $( go list -f {{.GoVersion}} -m) " }
92+ pushd " $TEST_INFRA_DIR " 1> /dev/null
93+ # Get the golang version from build_config.yaml
94+ GOLANG_VERSION=$( cat build_config.yaml | yq .go_version)
95+ BASE_IMAGE_VERSION=$( cat build_config.yaml | yq .eks_distro_version)
9496popd 1> /dev/null
9597
9698# if local build
@@ -109,6 +111,7 @@ if ! docker build \
109111 --build-arg service_controller_git_commit=" $SERVICE_CONTROLLER_GIT_COMMIT " \
110112 --build-arg build_date=" $BUILD_DATE " \
111113 --build-arg golang_version=" ${GOLANG_VERSION} " \
114+ --build-arg eks_distro_version=" ${BASE_IMAGE_VERSION} " \
112115 --build-arg go_arch=" $GOARCH " \
113116 --progress plain \
114117 " ${DOCKER_BUILD_CONTEXT} " ; then
You can’t perform that action at this time.
0 commit comments