From 35ccd32b50c1c535947c82bd330f3c801c6ff0d0 Mon Sep 17 00:00:00 2001 From: Jay Deokar Date: Tue, 1 Jul 2025 15:44:30 -0700 Subject: [PATCH] Updatign go runner version --- Dockerfile | 8 ++++++-- Makefile | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a3cc2b38..3ba57d6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ ARG BASE_IMAGE ARG BUILD_IMAGE +ARG GORUNNER_VERSION=public.ecr.aws/eks-distro/kubernetes/go-runner:v0.18.0-eks-1-32-16 ARG ARCH # Build the controller binary -FROM $BUILD_IMAGE as builder +FROM $BUILD_IMAGE AS builder WORKDIR /workspace ENV GOPROXY direct @@ -32,10 +33,13 @@ RUN GIT_VERSION=$(git describe --tags --always) && \ CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build \ -ldflags="-X ${VERSION_PKG}.GitVersion=${GIT_VERSION} -X ${VERSION_PKG}.GitCommit=${GIT_COMMIT} -X ${VERSION_PKG}.BuildDate=${BUILD_DATE}" -a -o controller main.go + +FROM $GORUNNER_VERSION AS go-runner + FROM $BASE_IMAGE WORKDIR / -COPY --from=public.ecr.aws/eks-distro/kubernetes/go-runner:v0.18.0-eks-1-32-16 /go-runner /usr/local/bin/go-runner +COPY --from=go-runner /go-runner /usr/local/bin/go-runner COPY --from=builder /workspace/controller . ENTRYPOINT ["/controller"] diff --git a/Makefile b/Makefile index 34dfe68c..07b721d7 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ IMAGE ?= $(REPO):$(VERSION) BASE_IMAGE ?= public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:latest.2 GOLANG_VERSION ?= $(shell cat .go-version) BUILD_IMAGE ?= public.ecr.aws/docker/library/golang:$(GOLANG_VERSION) +GORUNNER_VERSION ?= public.ecr.aws/eks-distro/kubernetes/go-runner:v0.18.0-eks-1-32-latest GOARCH ?= amd64 PLATFORM ?= linux/amd64 USER_ROLE_ARN ?= arn:aws:iam::$(AWS_ACCOUNT):role/VPCResourceControllerRole @@ -77,16 +78,16 @@ delete: ## Delete controller from ~/.kube/config # Build the docker image with buildx docker-buildx: check-env test - docker buildx build --platform=$(PLATFORM) -t $(IMAGE)-$(GOARCH) --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg $(GOARCH) --load . + docker buildx build --platform=$(PLATFORM) -t $(IMAGE)-$(GOARCH) --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg GORUNNER_VERSION=$(GORUNNER_VERSION) --build-arg $(GOARCH) --load . # Build the docker image docker-build: check-env test - docker build --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg ARCH=$(GOARCH) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) . -t ${IMAGE} + docker build --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg ARCH=$(GOARCH) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg GORUNNER_VERSION=$(GORUNNER_VERSION) . -t ${IMAGE} # Build the docker image with buildx and no tests docker-buildx-no-test: - docker buildx build --platform=$(PLATFORM) -t $(IMAGE)_$(GOARCH) --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg $(GOARCH) --load . + docker buildx build --platform=$(PLATFORM) -t $(IMAGE)_$(GOARCH) --build-arg BASE_IMAGE=$(BASE_IMAGE) --build-arg BUILD_IMAGE=$(BUILD_IMAGE) --build-arg GORUNNER_VERSION=$(GORUNNER_VERSION) --build-arg $(GOARCH) --load . # Push the docker image docker-push: check-env