Skip to content
Open
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
4 changes: 4 additions & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ ARG TAPRPC_VERSION
# Need to restate this since running in a new container from above.
ARG NO_UI

# Allow defining the CGO_ENABLED variable so we can build binaries
# that will work in a different type of container.
ARG CGO_ENABLED

Choose a reason for hiding this comment

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

high

This ARG is declared but it's not being used in the subsequent build steps, which means it currently has no effect. For this to work, CGO_ENABLED needs to be passed as an environment variable to the go install commands, which are run via make in this Dockerfile. You would need to modify the RUN command that invokes make to pass this environment variable.

It is also good practice to provide a default value. Given that GODEBUG=netdns=cgo is set elsewhere in the file, a default of 1 seems appropriate.

ARG CGO_ENABLED=1

Copy link
Author

Choose a reason for hiding this comment

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

It is also good practice to provide a default value. Given that GODEBUG=netdns=cgo is set elsewhere in the file, a default of 1 seems appropriate.

ARG CGO_ENABLED=1

This is a good idea, I was not aware that you could use this syntax to provide a default. This should already be the default, but your recommendation is more explicit.

Copy link
Author

Choose a reason for hiding this comment

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

This ARG is declared but it's not being used in the subsequent build steps, which means it currently has no effect. For this to work, CGO_ENABLED needs to be passed as an environment variable to the go install commands, which are run via make in this Dockerfile. You would need to modify the RUN command that invokes make to pass this environment variable.

I'm not sure if you are correct about this. I have tested this and it works as I expected it to.


# Install dependencies and install/build lightning-terminal.
RUN apk add --no-cache --update alpine-sdk make \
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
Expand Down
Loading