Skip to content

Updatign go runner version #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"]
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading