Skip to content

Commit e31a093

Browse files
authored
Merge pull request #1067 from ZZiigguurraatt/dev_Dockerfile_no_UI
dev.Dockerfile: allow skipping build of the web UI
2 parents 9b3349b + ac37b67 commit e31a093

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,22 @@ go-install-noui:
148148
$(GOINSTALL) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litd
149149
$(GOINSTALL) -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli
150150

151-
go-install-cli:
151+
go-install-cli-nolit:
152152
@$(call print, "Installing all CLI binaries.")
153153
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" github.com/lightningnetwork/lnd/cmd/lncli
154154
$(GOINSTALL) -trimpath -ldflags "$(LDFLAGS)" github.com/lightninglabs/loop/cmd/loop
155155
$(GOINSTALL) -trimpath github.com/lightninglabs/faraday/cmd/frcli
156156
$(GOINSTALL) -trimpath -ldflags "$(LDFLAGS)" github.com/lightninglabs/pool/cmd/pool
157157
$(GOINSTALL) -trimpath -ldflags "$(LDFLAGS)" github.com/lightninglabs/taproot-assets/cmd/tapcli
158+
159+
go-install-cli: go-install-cli-nolit
160+
@$(call print, "Installing litcli binary.")
158161
$(GOINSTALL) -trimpath -tags="$(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli
159162

163+
go-install-cli-noui: go-install-cli-nolit
164+
@$(call print, "Installing litcli binary without UI.")
165+
$(GOINSTALL) -trimpath -tags="litd_no_ui $(LND_RELEASE_TAGS)" -ldflags "$(LDFLAGS)" $(PKG)/cmd/litcli
166+
160167
app-build: yarn-install
161168
@$(call print, "Building production app.")
162169
cd app; yarn build

dev.Dockerfile

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ RUN apk add --no-cache --update git
77
# Copy in the local repository to build from.
88
COPY . /go/src/github.com/lightninglabs/lightning-terminal
99

10+
# Set to 1 to enable this option and skip build of the web UI.
11+
ARG NO_UI
12+
1013
RUN cd /go/src/github.com/lightninglabs/lightning-terminal/app \
11-
&& yarn install \
12-
&& yarn build
14+
&& if [ "$NO_UI" -eq "1" ]; then \
15+
echo "skipping UI build";\
16+
else \
17+
yarn install \
18+
&& yarn build; \
19+
fi
1320

1421
# The first stage is already done and all static assets should now be generated
1522
# in the app/build sub directory.
@@ -28,6 +35,9 @@ ENV GODEBUG netdns=cgo
2835
# queries that can be used to define a version.
2936
ARG TAPROOT_ASSETS_VERSION
3037

38+
# Need to restate this since running in a new container from above.
39+
ARG NO_UI
40+
3141
# Install dependencies and install/build lightning-terminal.
3242
RUN apk add --no-cache --update alpine-sdk make \
3343
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
@@ -36,8 +46,13 @@ RUN apk add --no-cache --update alpine-sdk make \
3646
go get -v github.com/lightninglabs/taproot-assets@$TAPROOT_ASSETS_VERSION \
3747
&& go mod tidy; \
3848
fi \
39-
&& make go-install \
40-
&& make go-install-cli
49+
&& if [ "$NO_UI" -eq "1" ]; then \
50+
make go-install-noui \
51+
&& make go-install-cli-noui; \
52+
else \
53+
make go-install \
54+
&& make go-install-cli; \
55+
fi
4156

4257
# Start a new, final image to reduce size.
4358
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d as final

0 commit comments

Comments
 (0)