Skip to content

Commit 27a5e4e

Browse files
committed
docker: fix yarn installation for ARM builds
This commit fixes multiple problems that seem to only appear when building the docker images for ARM.
1 parent a5ce600 commit 27a5e4e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,25 @@ FROM node:12.17.0-alpine as nodejsbuilder
66
# master by default.
77
ARG checkout="master"
88

9+
# There seem to be multiple problems when using yarn for a build inside of a
10+
# docker image:
11+
# 1. For building and installing node-gyp, python is required. This seems to
12+
# be missing from the NodeJS base image for ARM builds (or is just required
13+
# when building for ARM?).
14+
# 2. Because of a problem in the docker internal network on ARM, some TCP
15+
# packages are being dropped and the yarn installation times out. This can
16+
# be mitigated by switching to HTTP and increasing the network timeout.
17+
# See https://github.com/yarnpkg/yarn/issues/5259 for more info.
918
RUN apk add --no-cache --update alpine-sdk \
19+
python \
1020
git \
1121
&& git clone https://github.com/lightninglabs/lightning-terminal /go/src/github.com/lightninglabs/lightning-terminal \
1222
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
1323
&& git checkout $checkout \
1424
&& cd app \
15-
&& yarn install \
25+
&& npm config set registry "http://registry.npmjs.org" \
26+
&& yarn config set registry "http://registry.npmjs.org" \
27+
&& yarn install --frozen-lockfile --network-timeout 1000000 \
1628
&& yarn build
1729

1830
# The first stage is already done and all static assets should now be generated

0 commit comments

Comments
 (0)