File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,13 @@ ARG NO_UI
7070ARG CGO_ENABLED=1
7171
7272# Install dependencies and install/build lightning-terminal.
73- RUN apk add --no-cache --update alpine-sdk make \
73+ # Note: When using `docker build`, setting the environmental variable
74+ # `DOCKER_BUILDKIT=1` is required to enable
75+ # [BuildKit](https://docs.docker.com/build/buildkit)
76+ # so that the cache mounts can be used.
77+ RUN --mount=type=cache,target=/go/pkg/mod \
78+ --mount=type=cache,target=/root/.cache/go-build \
79+ apk add --no-cache --update alpine-sdk make \
7480 && cd /go/src/github.com/lightninglabs/lightning-terminal \
7581 # If a custom lnd version is supplied, force it now.
7682 && if [ -n "$LND_VERSION" ]; then \
Original file line number Diff line number Diff line change 1717
1818### Functional Changes/Additions
1919
20+ * ` dev.Dockerfile ` now uses
21+ [ cache mounts] ( https://docs.docker.com/build/cache/optimize/#use-cache-mounts )
22+ to cache the ` GOMODCACHE ` and ` GOCACHE ` directories so that dependencies don't
23+ need to be re-downloaded and re-built every time the image is re-created. This
24+ is particularly useful when the build context is a remote git repo and not a
25+ local filesystem, which often times causes a ` COPY ` layer cache and all the
26+ subsequent build layer caches to be invalidated. As a result of this change,
27+ ` dev.Dockerfile ` now requires
28+ [ BuildKit] ( https://docs.docker.com/build/buildkit ) to build. When using
29+ ` docker build ` , this can be enabled by setting the environmental variable
30+ ` DOCKER_BUILDKIT=1 ` .
31+
32+
2033### Technical and Architectural Updates
2134
2235## RPC Updates
You can’t perform that action at this time.
0 commit comments