1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-02-07 13:41:38 +02:00

Minor change to the Dockerfile to improve build speed (#1139)

"go mod download" does not depend on the VERSION env var, so moving the ARG directive after the RUN will allow better use of the Docker build cache - subsequent builds on the same machine need only re-run the "go mod download" if go.mod or go.sum has changed, rather than re-running it any time the VERSION value passed from the Makefile has changed

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
This commit is contained in:
Ian Roberts 2021-03-29 19:08:40 +01:00 committed by GitHub
parent 3315e5d4b8
commit 3fc194ee72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,4 @@
FROM golang:1.16-buster AS builder
ARG VERSION
# Copy sources
WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy
@ -11,6 +10,8 @@ RUN GO111MODULE=on go mod download
# Now pull in our code
COPY . .
ARG VERSION
# Build binary and make sure there is at least an empty key file.
# This is useful for GCP App Engine custom runtime builds, because
# you cannot use multiline variables in their app.yaml, so you have to

View File

@ -1,5 +1,4 @@
FROM golang:1.16-buster AS builder
ARG VERSION
# Copy sources
WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy
@ -11,6 +10,8 @@ RUN GO111MODULE=on go mod download
# Now pull in our code
COPY . .
ARG VERSION
# Build binary and make sure there is at least an empty key file.
# This is useful for GCP App Engine custom runtime builds, because
# you cannot use multiline variables in their app.yaml, so you have to

View File

@ -1,5 +1,4 @@
FROM golang:1.16-buster AS builder
ARG VERSION
# Copy sources
WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy
@ -11,6 +10,8 @@ RUN GO111MODULE=on go mod download
# Now pull in our code
COPY . .
ARG VERSION
# Build binary and make sure there is at least an empty key file.
# This is useful for GCP App Engine custom runtime builds, because
# you cannot use multiline variables in their app.yaml, so you have to