@@ -30,13 +30,29 @@ COPY --from=nodejsbuilder /go/src/github.com/lightninglabs/lightning-terminal /g
3030#  queries required to connect to linked containers succeed.
3131ENV  GODEBUG netdns=cgo
3232
33- #  Allow forcing a specific lnd, taproot-assets, and taprpc version through a
33+ #  Allow forcing a specific lnd, taproot-assets, and/or taprpc repo so that
34+ #  commits referenced by LND_VERSION, TAPROOT_ASSETS_VERSION, and TAPRPC_VERSION
35+ #  don't have to exist in the default repository. If any of these build arguments
36+ #  are not defined, the build continues using the default repository for that
37+ #  module. NOTE: If these arguments ARE defined then the corresponding `_VERSION`
38+ #  argument MUST also be defined, otherwise the build continues using the default
39+ #  repository defined for that module.
40+ 
41+ ARG  LND_REPO
42+ ARG  TAPROOT_ASSETS_REPO
43+ ARG  TAPRPC_REPO
44+ ARG  LOOP_REPO
45+ 
46+ #  Allow forcing a specific lnd, taproot-assets, and/or taprpc version through a
3447#  build argument.
3548#  Please see https://go.dev/ref/mod#version-queries for the types of
3649#  queries that can be used to define a version.
50+ #  If any of these build arguments are not defined then build uses the version
51+ #  already defined in go.mod and go.sum for that module.
3752ARG  LND_VERSION
3853ARG  TAPROOT_ASSETS_VERSION
3954ARG  TAPRPC_VERSION
55+ ARG  LOOP_VERSION
4056
4157#  Need to restate this since running in a new container from above.
4258ARG  NO_UI
@@ -46,17 +62,42 @@ RUN apk add --no-cache --update alpine-sdk make \
4662  && cd /go/src/github.com/lightninglabs/lightning-terminal \
4763  #  If a custom lnd version is supplied, force it now.
4864  && if [ -n "$LND_VERSION"  ]; then \
49-     go get -v github.com/lightningnetwork/lnd@$LND_VERSION \
65+     #  If a custom lnd repo is supplied, force it now.
66+     if [ -n "$LND_REPO"  ]; then \
67+       go mod edit -replace=github.com/lightningnetwork/lnd=$LND_REPO@$LND_VERSION; \
68+     else \
69+       go get -v github.com/lightningnetwork/lnd@$LND_VERSION; \
70+     fi \
5071    && go mod tidy; \
5172  fi \
5273  #  If a custom taproot-assets version is supplied, force it now.
5374  && if [ -n "$TAPROOT_ASSETS_VERSION"  ]; then \
54-     go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION \
75+     #  If a custom taproot-assets repo is supplied, force it now.
76+     if [ -n "$TAPROOT_ASSETS_REPO"  ]; then \
77+       go mod edit -replace=github.com/lightninglabs/taproot-assets=$TAPROOT_ASSETS_REPO@$TAPROOT_ASSETS_VERSION; \
78+     else \
79+       go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION; \
80+     fi \
5581    && go mod tidy; \
5682  fi \
5783  #  If a custom taprpc version is supplied, force it now.
5884  && if [ -n "$TAPRPC_VERSION"  ]; then \
59-     go get -v github.com/lightninglabs/taproot-assets/taprpc@$TAPRPC_VERSION \
85+     #  If a custom taprpc repo is supplied, force it now.
86+     if [ -n "$TAPRPC_REPO"  ]; then \
87+       go mod edit -replace=github.com/lightninglabs/taproot-assets/taprpc=$TAPRPC_REPO@$TAPRPC_VERSION; \
88+     else \
89+       go get -v github.com/lightninglabs/taproot-assets/taprpc@$TAPRPC_VERSION; \
90+     fi \
91+     && go mod tidy; \
92+   fi \
93+   #  If a custom loop version is supplied, force it now.
94+   && if [ -n "$LOOP_VERSION"  ]; then \
95+     #  If a custom loop repo is supplied, force it now.
96+     if [ -n "$LOOP_REPO"  ]; then \
97+       go mod edit -replace=github.com/lightninglabs/loop=$LOOP_REPO@$LOOP_VERSION; \
98+     else \
99+       go get -v github.com/lightninglabs/loop@$LOOP_VERSION; \
100+     fi \
60101    && go mod tidy; \
61102  fi \
62103  && if [ "$NO_UI"  -eq "1"  ]; then \
0 commit comments