File tree 3 files changed +15
-7
lines changed
3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
1
# 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
3
3
4
4
# Golang image to use for compiling the manager
5
5
ARG builder_image=public.ecr.aws/docker/library/golang
6
6
7
7
# Version of Golang
8
8
ARG golang_version
9
+ # Version of eks-distro
10
+ ARG eks_distro_version
9
11
10
12
# Build the manager binary
11
13
FROM $builder_image:$golang_version as builder
@@ -49,7 +51,7 @@ RUN GIT_VERSION=$service_controller_git_version && \
49
51
-X ${VERSION_PKG}.BuildDate=${BUILD_DATE}" \
50
52
-a -o $work_dir/bin/controller $work_dir/cmd/controller/main.go
51
53
52
- FROM $base_image
54
+ FROM $base_image:$eks_distro_version
53
55
ARG base_image
54
56
LABEL org.opencontainers.image.base.name=$base_image
55
57
ARG service_alias
Original file line number Diff line number Diff line change 1
1
# 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
3
3
4
4
# Golang image to use for compiling the manager
5
5
ARG builder_image=public.ecr.aws/docker/library/golang
6
6
7
7
# Version of Golang
8
8
ARG golang_version
9
9
10
+ # Version of eks-distro
11
+ ARG eks_distro_version
12
+
10
13
# Build the manager binary
11
14
FROM $builder_image:$golang_version as builder
12
15
@@ -68,7 +71,7 @@ RUN GIT_VERSION=$service_controller_git_version && \
68
71
-X ${VERSION_PKG}.BuildDate=${BUILD_DATE}" \
69
72
-a -o $work_dir/bin/controller $work_dir/cmd/controller/main.go
70
73
71
- FROM $base_image
74
+ FROM $base_image:$eks_distro_version
72
75
ARG base_image
73
76
LABEL org.opencontainers.image.base.name=$base_image
74
77
ARG service_alias
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ set -eo pipefail
5
5
DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
6
6
SCRIPTS_DIR=$DIR
7
7
ROOT_DIR=$DIR /..
8
+ TEST_INFRA_DIR=$ROOT_DIR /../test-infra
8
9
DOCKERFILE_PATH=$ROOT_DIR /Dockerfile
9
10
ACK_DIR=$ROOT_DIR /..
10
11
DOCKERFILE=${DOCKERFILE:- " $DOCKERFILE_PATH " }
@@ -88,9 +89,10 @@ if ! is_public_ecr_logged_in; then
88
89
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
89
90
fi
90
91
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)
94
96
popd 1> /dev/null
95
97
96
98
# if local build
@@ -109,6 +111,7 @@ if ! docker build \
109
111
--build-arg service_controller_git_commit=" $SERVICE_CONTROLLER_GIT_COMMIT " \
110
112
--build-arg build_date=" $BUILD_DATE " \
111
113
--build-arg golang_version=" ${GOLANG_VERSION} " \
114
+ --build-arg eks_distro_version=" ${BASE_IMAGE_VERSION} " \
112
115
--build-arg go_arch=" $GOARCH " \
113
116
--progress plain \
114
117
" ${DOCKER_BUILD_CONTEXT} " ; then
You can’t perform that action at this time.
0 commit comments