mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
chore: update Dockerfile.dev-self-contained to allow better build cache (#1755)
This commit is contained in:
parent
d1f58c538a
commit
9b28fbc24d
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue