@@ -77,7 +77,8 @@ RUN apt-get update -qq && \
77
77
jq \
78
78
libtool \
79
79
gettext \
80
- protobuf-compiler
80
+ protobuf-compiler \
81
+ qemu-user-static
81
82
82
83
ARG ZLIB_URL=https://github.com/madler/zlib/releases/download
83
84
ARG ZLIB_VERSION=1.2.13
@@ -137,38 +138,22 @@ FROM base-builder AS base-builder-linux-amd64
137
138
138
139
ARG target_host=x86_64-linux-gnu
139
140
ARG target_host_rust=x86_64-unknown-linux-gnu
140
- ARG target_host_libc=amd64
141
- ARG target_host_gcc=x86-64-linux-gnu
142
141
143
142
FROM base-builder AS base-builder-linux-arm64
144
143
145
144
ARG target_host=aarch64-linux-gnu
146
145
ARG target_host_rust=aarch64-unknown-linux-gnu
147
- ARG target_host_libc=arm64
148
- ARG target_host_gcc=aarch64-linux-gnu
149
146
150
147
FROM base-builder AS base-builder-linux-arm
151
148
152
149
ARG target_host=arm-linux-gnueabihf
153
150
ARG target_host_rust=armv7-unknown-linux-gnueabihf
154
- ARG target_host_libc=armhf
155
- ARG target_host_gcc=arm-linux-gnueabihf
156
151
157
152
FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
158
153
159
154
ENV RUST_PROFILE=release
160
155
ENV LIGHTNINGD_VERSION=master
161
156
162
- WORKDIR /opt
163
-
164
- RUN ./install-poetry.py
165
- RUN ./install-rust.sh -y --target ${target_host_rust} --profile minimal
166
-
167
- ARG POETRY_VIRTUALENVS_CREATE=false
168
- ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
169
-
170
- RUN rustup toolchain install stable --component rustfmt --allow-downgrade
171
-
172
157
ARG AR=${target_host}-ar
173
158
ARG AS=${target_host}-as
174
159
ARG CC=${target_host}-gcc
@@ -179,12 +164,12 @@ ARG QEMU_LD_PREFIX=/usr/${target_host}
179
164
ARG TARGET=${target_host_rust}
180
165
ARG PKG_CONFIG_PATH=${QEMU_LD_PREFIX}/lib/pkgconfig
181
166
182
- RUN apt-get install -qq -y --no-install-recommends \
183
- libc6-${target_host_libc}-cross \
184
- gcc-${target_host_gcc} \
185
- g++-${target_host_gcc}
167
+ WORKDIR /opt
168
+
169
+ RUN ./install-poetry.py
170
+ RUN ./install-rust.sh -y --target ${target_host_rust} --profile minimal --component rustfmt
186
171
187
- # TODO: speedup, anything below this is super slow.
172
+ ENV PATH= "/root/.cargo/bin:/root/.local/bin:${PATH}"
188
173
189
174
WORKDIR /opt/zlib
190
175
@@ -217,6 +202,8 @@ RUN mkdir -p .cargo && tee .cargo/config.toml <<-EOF
217
202
linker = "${target_host}-gcc"
218
203
EOF
219
204
205
+ ARG POETRY_VIRTUALENVS_CREATE=false
206
+
220
207
RUN poetry lock && \
221
208
poetry install --no-root --no-interaction --no-ansi
222
209
@@ -239,11 +226,7 @@ RUN apt-get update -qq && \
239
226
apt-get clean && \
240
227
rm -rf /var/lib/apt/lists/*
241
228
242
- ENV LIGHTNINGD_DATA=/root/.lightning
243
- ENV LIGHTNINGD_RPC_PORT=9835
244
- ENV LIGHTNINGD_PORT=9735
245
- ENV LIGHTNINGD_NETWORK=bitcoin
246
-
229
+ # TODO: only copy necessary bitcoin/litecoin binaries.
247
230
COPY --from=downloader /opt/bitcoin/bin/ /usr/bin/
248
231
COPY --from=downloader /opt/litecoin/bin/ /usr/bin/
249
232
COPY --from=builder /tmp/lightning_install/ /usr/local/
@@ -253,6 +236,11 @@ COPY tools/docker-entrypoint.sh /entrypoint.sh
253
236
254
237
# TODO: user creation. user permissions on volume.
255
238
239
+ ENV LIGHTNINGD_DATA=/root/.lightning
240
+ ENV LIGHTNINGD_RPC_PORT=9835
241
+ ENV LIGHTNINGD_PORT=9735
242
+ ENV LIGHTNINGD_NETWORK=bitcoin
243
+
256
244
EXPOSE 9735 9835
257
245
VOLUME ["/root/.lightning" ]
258
246
ENTRYPOINT ["/entrypoint.sh" ]
0 commit comments