Skip to content

Commit 753c60e

Browse files
committed
Make controller base_image version an argument
This change allows us to pass the base image version as an argument allowing us to pass the latest one after each release
1 parent 9b58156 commit 753c60e

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
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
55
ARG builder_image=public.ecr.aws/docker/library/golang
66

77
# Version of Golang
88
ARG golang_version
9+
# Version of eks-distro
10+
ARG eks_distro_version
911

1012
# Build the manager binary
1113
FROM $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
5355
ARG base_image
5456
LABEL org.opencontainers.image.base.name=$base_image
5557
ARG service_alias

Dockerfile.local

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
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
55
ARG builder_image=public.ecr.aws/docker/library/golang
66

77
# Version of Golang
88
ARG golang_version
99

10+
# Version of eks-distro
11+
ARG eks_distro_version
12+
1013
# Build the manager binary
1114
FROM $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
7275
ARG base_image
7376
LABEL org.opencontainers.image.base.name=$base_image
7477
ARG service_alias

scripts/build-controller-image.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ fi
9191
pushd "$ROOT_DIR" 1>/dev/null
9292
# Get the golang version from the code-generator
9393
GOLANG_VERSION=${GOLANG_VERSION:-"$(go list -f {{.GoVersion}} -m)"}
94+
BASE_IMAGE_VERSION=${BASE_IMAGE_VERSION:-"$(echo 2024-08-13-1723575672.2)"}
9495
popd 1>/dev/null
9596

9697
# if local build
@@ -109,6 +110,7 @@ if ! docker build \
109110
--build-arg service_controller_git_commit="$SERVICE_CONTROLLER_GIT_COMMIT" \
110111
--build-arg build_date="$BUILD_DATE" \
111112
--build-arg golang_version="${GOLANG_VERSION}" \
113+
--build-arg eks_distro_version="${BASE_IMAGE_VERSION}" \
112114
--build-arg go_arch="$GOARCH" \
113115
--progress plain \
114116
"${DOCKER_BUILD_CONTEXT}"; then

0 commit comments

Comments
 (0)