From 1d5e29fe881d883617692daf0fca80a90e295dbd Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Thu, 29 Aug 2024 11:30:50 +1000 Subject: [PATCH] chore: update dockerfile --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f63dd2f..58dfbbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,17 @@ ARG MTK_VERSION # build MTK from source -FROM golang:1.18-alpine as builder +FROM golang:1.22-alpine as builder WORKDIR /go/src/github.com/skpr RUN apk add --virtual --update-cache git && \ rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* -RUN git clone https://github.com/skpr/mtk.git && cd mtk && git checkout $MTK_VERSION -WORKDIR /go/src/github.com/skpr/mtk/dump +ADD https://github.com/skpr/mtk.git#$MTK_VERSION ./mtk + +WORKDIR /go/src/github.com/skpr/mtk # compile -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin/mtk-dump github.com/skpr/mtk/dump +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin/mtk-dump github.com/skpr/mtk/cmd/mtk ARG IMAGE_REPO FROM ${IMAGE_REPO:-uselagoon}/commons as commons @@ -18,7 +19,7 @@ FROM ${IMAGE_REPO:-uselagoon}/commons as commons # Put in some labels so people know what this image is for LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors" -COPY --from=builder /go/src/github.com/skpr/mtk/dump/bin/mtk-dump /usr/local/bin/mtk-dump +COPY --from=builder /go/src/github.com/skpr/mtk/bin/mtk-dump /usr/local/bin/mtk-dump # Install necessary packages # - perl for docker-login