From 99e91d241cf5ef02353039ca86495bacc54a7fcf Mon Sep 17 00:00:00 2001 From: Benjamin Gandon Date: Fri, 10 May 2024 18:44:45 +0200 Subject: [PATCH] Re-order Dockerfile statements to properly benefit from cache --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 94d054f..bc27eb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ ARG golang ARG alpine + + FROM ${golang} AS builder +RUN curl -sL https://taskfile.dev/install.sh | sh /dev/stdin v3.33.1 ADD . /go/src/github.com/telia-oss/github-pr-resource WORKDIR /go/src/github.com/telia-oss/github-pr-resource -RUN curl -sL https://taskfile.dev/install.sh | sh /dev/stdin v3.33.1 RUN ./bin/task build FROM ${alpine} AS resource -COPY --from=builder /go/src/github.com/telia-oss/github-pr-resource/build /opt/resource RUN apk add --update --no-cache \ git \ git-lfs \ openssh \ - git-crypt \ - && chmod +x /opt/resource/* + git-crypt COPY scripts/askpass.sh /usr/local/bin/askpass.sh +COPY --from=builder /go/src/github.com/telia-oss/github-pr-resource/build /opt/resource +RUN chmod +x /opt/resource/* FROM resource LABEL MAINTAINER=telia-oss