chore: update Dockerfile.dev-self-contained to allow better build cache (#1755)

pull/1771/head
jebabin 1 year ago committed by GitHub
parent d1f58c538a
commit 9b28fbc24d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,6 +7,13 @@ FROM golang:alpine as builder
# use version (for example "v0.3.3") or "main" # use version (for example "v0.3.3") or "main"
ARG WATCHTOWER_VERSION=main ARG WATCHTOWER_VERSION=main
# Pre download required modules to avoid redownloading at each build thanks to docker layer caching.
# Copying go.mod and go.sum ensure to invalid the layer/build cache if there is a change in module requirement
WORKDIR /watchtower
COPY go.mod .
COPY go.sum .
RUN go mod download
RUN apk add --no-cache \ RUN apk add --no-cache \
alpine-sdk \ alpine-sdk \
ca-certificates \ ca-certificates \

Loading…
Cancel
Save