@@ -30,13 +30,35 @@ COPY --from=nodejsbuilder /go/src/github.com/lightninglabs/lightning-terminal /g
30
30
# queries required to connect to linked containers succeed.
31
31
ENV GODEBUG netdns=cgo
32
32
33
- # Allow forcing a specific lnd, taproot-assets, and taprpc version through a
34
- # build argument.
33
+ # Allow forcing a specific lnd, taproot-assets, taprpc, and/or loop repo so that
34
+ # commits referenced by LND_VERSION, TAPROOT_ASSETS_VERSION, TAPRPC_VERSION, and
35
+ # LOOP_VERSION don't have to exist in the default repository. If any of these
36
+ # build arguments are not defined, the build continues using the default
37
+ # repository for that module. NOTE: If these arguments ARE defined then the
38
+ # corresponding `_VERSION` argument MUST also be defined, otherwise the build
39
+ # continues using the default repository defined for that module.
40
+ ARG LND_REPO
41
+ ARG TAPROOT_ASSETS_REPO
42
+ ARG TAPRPC_REPO
43
+ ARG LOOP_REPO
44
+
45
+ # Allow forcing a specific lnd, taproot-assets, taprpc, and/or loop version
46
+ # through a build argument.
35
47
# Please see https://go.dev/ref/mod#version-queries for the types of
36
48
# queries that can be used to define a version.
49
+ # If any of these build arguments are not defined then build uses the version
50
+ # already defined in go.mod and go.sum for that module.
51
+ # Note: If the corresponding `_REPO` argument is not defined, `go get` will
52
+ # be used along with `go mod tidy`, which sometimes may change the version you
53
+ # are trying to use because some other module requires the same requirement
54
+ # but of a different version. A trick to overcome this is to also use the
55
+ # `_REPO` argument and just put in the default repository for that module and
56
+ # that will cause a `go mod edit -replace=` to be used instead which won't have
57
+ # this issue.
37
58
ARG LND_VERSION
38
59
ARG TAPROOT_ASSETS_VERSION
39
60
ARG TAPRPC_VERSION
61
+ ARG LOOP_VERSION
40
62
41
63
# Need to restate this since running in a new container from above.
42
64
ARG NO_UI
@@ -46,17 +68,42 @@ RUN apk add --no-cache --update alpine-sdk make \
46
68
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
47
69
# If a custom lnd version is supplied, force it now.
48
70
&& if [ -n "$LND_VERSION" ]; then \
49
- go get -v github.com/lightningnetwork/lnd@$LND_VERSION \
71
+ # If a custom lnd repo is supplied, force it now.
72
+ if [ -n "$LND_REPO" ]; then \
73
+ go mod edit -replace=github.com/lightningnetwork/lnd=$LND_REPO@$LND_VERSION; \
74
+ else \
75
+ go get -v github.com/lightningnetwork/lnd@$LND_VERSION; \
76
+ fi \
50
77
&& go mod tidy; \
51
78
fi \
52
79
# If a custom taproot-assets version is supplied, force it now.
53
80
&& if [ -n "$TAPROOT_ASSETS_VERSION" ]; then \
54
- go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION \
81
+ # If a custom taproot-assets repo is supplied, force it now.
82
+ if [ -n "$TAPROOT_ASSETS_REPO" ]; then \
83
+ go mod edit -replace=github.com/lightninglabs/taproot-assets=$TAPROOT_ASSETS_REPO@$TAPROOT_ASSETS_VERSION; \
84
+ else \
85
+ go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION; \
86
+ fi \
55
87
&& go mod tidy; \
56
88
fi \
57
89
# If a custom taprpc version is supplied, force it now.
58
90
&& if [ -n "$TAPRPC_VERSION" ]; then \
59
- go get -v github.com/lightninglabs/taproot-assets/taprpc@$TAPRPC_VERSION \
91
+ # If a custom taprpc repo is supplied, force it now.
92
+ if [ -n "$TAPRPC_REPO" ]; then \
93
+ go mod edit -replace=github.com/lightninglabs/taproot-assets/taprpc=$TAPRPC_REPO@$TAPRPC_VERSION; \
94
+ else \
95
+ go get -v github.com/lightninglabs/taproot-assets/taprpc@$TAPRPC_VERSION; \
96
+ fi \
97
+ && go mod tidy; \
98
+ fi \
99
+ # If a custom loop version is supplied, force it now.
100
+ && if [ -n "$LOOP_VERSION" ]; then \
101
+ # If a custom loop repo is supplied, force it now.
102
+ if [ -n "$LOOP_REPO" ]; then \
103
+ go mod edit -replace=github.com/lightninglabs/loop=$LOOP_REPO@$LOOP_VERSION; \
104
+ else \
105
+ go get -v github.com/lightninglabs/loop@$LOOP_VERSION; \
106
+ fi \
60
107
&& go mod tidy; \
61
108
fi \
62
109
&& if [ "$NO_UI" -eq "1" ]; then \
0 commit comments