Skip to content

Commit

Permalink
Cache Go dependencies in a Docker layer to speed up build
Browse files Browse the repository at this point in the history
  • Loading branch information
cristim committed Oct 14, 2021
1 parent 982005c commit f3ffb47
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile.marketplace
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM golang:alpine as golang
RUN apk add -U --no-cache ca-certificates git make
COPY . /src

COPY go.mod go.sum /src/
# Download dependencies
WORKDIR /src
RUN FLAVOR=stable CGO_ENABLED=0 GOPROXY=direct make
RUN GOPROXY=direct go mod download

COPY . /src

RUN FLAVOR=stable CGO_ENABLED=0 GOPROXY=direct SAVINGS_CUT=$savings_cut make

FROM alpine:latest
COPY LICENSE BINARY_LICENSE THIRDPARTY /
Expand Down

0 comments on commit f3ffb47

Please sign in to comment.