From 1011463246115d6d449391d31dafd82f653d1d83 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Tue, 10 Dec 2024 07:40:29 -0500 Subject: [PATCH] update golang to 1.23 and fix docker warnings --- Dockerfile | 9 ++++----- go.mod | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10c68f79..da2ff121 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -ARG BASE_IMAGE -ARG BUILDER_IMAGE +ARG BUILDER_IMAGE=golang:1.23 +ARG BASE_IMAGE=gcr.io/distroless/static:nonroot # Build the manager binary -FROM ${BUILDER_IMAGE} as builder +FROM ${BUILDER_IMAGE} AS builder ARG TARGETOS ARG TARGETARCH -ARG CGO_ENABLED WORKDIR /workspace # Copy the Go Modules manifests @@ -29,7 +28,7 @@ COPY pkg/utils pkg/utils # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go +RUN CGO_ENABLED=${CGO_ENABLED:-0} GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go FROM ${BASE_IMAGE} WORKDIR / diff --git a/go.mod b/go.mod index 86614fdd..602e65dd 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/lws -go 1.22.0 +go 1.23.0 require ( github.com/google/go-cmp v0.6.0