Skip to content

dev.Dockerfile: allow forcing a taprpc version #1116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ COPY --from=nodejsbuilder /go/src/github.com/lightninglabs/lightning-terminal /g
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo

# Allow forcing a specific lnd and taproot-assets version through a build
# argument.
# Allow forcing a specific lnd, taproot-assets, and taprpc version through a
# build argument.
# Please see https://go.dev/ref/mod#version-queries for the types of
# queries that can be used to define a version.
ARG LND_VERSION
ARG TAPROOT_ASSETS_VERSION
ARG TAPRPC_VERSION

# Need to restate this since running in a new container from above.
ARG NO_UI
Expand All @@ -53,6 +54,11 @@ RUN apk add --no-cache --update alpine-sdk make \
go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION \
&& go mod tidy; \
fi \
# If a custom taprpc version is supplied, force it now.
&& if [ -n "$TAPRPC_VERSION" ]; then \
go get -v github.com/lightninglabs/taproot-assets/taprpc@$TAPRPC_VERSION \
&& go mod tidy; \
fi \
Comment on lines +58 to +61

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change is consistent with the existing pattern for overriding dependencies, the pattern of running go mod tidy after each go get is inefficient as it can run up to three times. This increases the build time.

A more efficient approach would be to run all the go get commands first, and then run go mod tidy a single time at the end if any of the version arguments were provided.

This could be addressed in a follow-up PR to refactor this part of the Dockerfile for better build performance.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't like that because it requires more if statements and I don't think go mod tidy runs that long

&& if [ "$NO_UI" -eq "1" ]; then \
make go-install-noui \
&& make go-install-cli-noui; \
Expand Down
Loading