From 0eb8f747af664ec30fe61a5a33052b18b8984e07 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 22 Aug 2023 14:38:11 +0100 Subject: [PATCH 1/2] Update container version - Update multiarch build container to use golang:1.19 as the project is tested on 1.19 - Update the multiarch container to run Alpine 3.18 Updating to this version reduces the number of known vulnerabilities in the image - Update go.mod to match the container version --- Dockerfile.multiarch | 4 ++-- go.mod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.multiarch b/Dockerfile.multiarch index 07be544b..3b9dc458 100644 --- a/Dockerfile.multiarch +++ b/Dockerfile.multiarch @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.18 as build-env +FROM --platform=$BUILDPLATFORM golang:1.19 as build-env # xx wraps go to automatically configure $GOOS, $GOARCH, and $GOARM # based on TARGETPLATFORM provided by Docker. @@ -13,7 +13,7 @@ WORKDIR ${APP_FOLDER} ARG TARGETPLATFORM RUN CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o /bin/main ./cmd/nfs-subdir-external-provisioner -FROM --platform=$TARGETPLATFORM alpine:3.12 +FROM --platform=$TARGETPLATFORM alpine:3.18 RUN apk update --no-cache && apk add ca-certificates COPY --from=build-env /bin/main /app/main diff --git a/go.mod b/go.mod index 9c28b292..f88d77c3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubernetes-sigs/nfs-subdir-external-provisioner -go 1.17 +go 1.19 require ( github.com/golang/glog v1.0.0 From ed64e85e91e64f5263a375306221f2e3324510ff Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 22 Aug 2023 14:45:07 +0100 Subject: [PATCH 2/2] Fix boilerplate warning Running make test-boilerplate returned the following error so fixed accordingly Header in kubernetes-sigs/nfs-subdir-external-provisioner/release-tools/../Dockerfile does not match reference, diff: --- reference +++ kubernetes-sigs/nfs-subdir-external-provisioner/release-tools/../Dockerfile @@ -1,4 +1,4 @@ -# Copyright YEAR The Kubernetes Authors. +# Copyright YEAR-YEAR The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2aba5953..22eaa768 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2017-2020 The Kubernetes Authors. +# Copyright 2023 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.