From 231937b39750c5b84b5ea38faecdabfc8587e81a Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:29:02 +0100 Subject: [PATCH 1/2] dockerfile: use go install for addlicense Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- hack/dockerfiles/license.Dockerfile | 33 +++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/hack/dockerfiles/license.Dockerfile b/hack/dockerfiles/license.Dockerfile index dc0434e..04c6c7b 100644 --- a/hack/dockerfiles/license.Dockerfile +++ b/hack/dockerfiles/license.Dockerfile @@ -14,23 +14,44 @@ # See the License for the specific language governing permissions and # limitations under the License. +ARG ADDLICENSE_VERSION="v1.0.0" +ARG ALPINE_VERSION="3.21" +ARG GO_VERSION="1.23" +ARG XX_VERSION="1.6.1" + ARG LICENSE_HOLDER="actions-toolkit authors" ARG LICENSE_TYPE="apache" ARG LICENSE_FILES=".*\(Dockerfile\|Makefile\|\.js\|\.ts\|\.hcl\|\.sh|\.ps1\)" -ARG ADDLICENSE_VERSION="v1.0.0" -FROM ghcr.io/google/addlicense:${ADDLICENSE_VERSION} AS addlicense +FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx -FROM alpine:3.17 AS base -WORKDIR /src +FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base RUN apk add --no-cache cpio findutils git +ENV CGO_ENABLED=0 +WORKDIR /src +COPY --link --from=xx / / + +FROM base AS addlicense +ARG ADDLICENSE_VERSION +ARG TARGETPLATFORM +RUN --mount=target=/root/.cache,type=cache \ + --mount=type=cache,target=/go/pkg/mod < Date: Mon, 13 Jan 2025 14:29:17 +0100 Subject: [PATCH 2/2] dockerfile: update addlicense to v1.1.1 Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- hack/dockerfiles/license.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/dockerfiles/license.Dockerfile b/hack/dockerfiles/license.Dockerfile index 04c6c7b..1a06b25 100644 --- a/hack/dockerfiles/license.Dockerfile +++ b/hack/dockerfiles/license.Dockerfile @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG ADDLICENSE_VERSION="v1.0.0" +ARG ADDLICENSE_VERSION="v1.1.1" ARG ALPINE_VERSION="3.21" ARG GO_VERSION="1.23" ARG XX_VERSION="1.6.1"