Skip to content

Commit 008f67c

Browse files
author
Claudio Raimondi
committed
Add TODOs [skip ci]
1 parent 5ed9e54 commit 008f67c

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

Dockerfile

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ RUN apt-get update -qq && \
7777
jq \
7878
libtool \
7979
gettext \
80-
protobuf-compiler
80+
protobuf-compiler \
81+
qemu-user-static
8182

8283
ARG ZLIB_URL=https://github.com/madler/zlib/releases/download
8384
ARG ZLIB_VERSION=1.2.13
@@ -137,38 +138,22 @@ FROM base-builder AS base-builder-linux-amd64
137138

138139
ARG target_host=x86_64-linux-gnu
139140
ARG target_host_rust=x86_64-unknown-linux-gnu
140-
ARG target_host_libc=amd64
141-
ARG target_host_gcc=x86-64-linux-gnu
142141

143142
FROM base-builder AS base-builder-linux-arm64
144143

145144
ARG target_host=aarch64-linux-gnu
146145
ARG target_host_rust=aarch64-unknown-linux-gnu
147-
ARG target_host_libc=arm64
148-
ARG target_host_gcc=aarch64-linux-gnu
149146

150147
FROM base-builder AS base-builder-linux-arm
151148

152149
ARG target_host=arm-linux-gnueabihf
153150
ARG target_host_rust=armv7-unknown-linux-gnueabihf
154-
ARG target_host_libc=armhf
155-
ARG target_host_gcc=arm-linux-gnueabihf
156151

157152
FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
158153

159154
ENV RUST_PROFILE=release
160155
ENV LIGHTNINGD_VERSION=master
161156

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-
172157
ARG AR=${target_host}-ar
173158
ARG AS=${target_host}-as
174159
ARG CC=${target_host}-gcc
@@ -179,12 +164,12 @@ ARG QEMU_LD_PREFIX=/usr/${target_host}
179164
ARG TARGET=${target_host_rust}
180165
ARG PKG_CONFIG_PATH=${QEMU_LD_PREFIX}/lib/pkgconfig
181166

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
186171

187-
#TODO: speedup, anything below this is super slow.
172+
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
188173

189174
WORKDIR /opt/zlib
190175

@@ -217,6 +202,8 @@ RUN mkdir -p .cargo && tee .cargo/config.toml <<-EOF
217202
linker = "${target_host}-gcc"
218203
EOF
219204

205+
ARG POETRY_VIRTUALENVS_CREATE=false
206+
220207
RUN poetry lock && \
221208
poetry install --no-root --no-interaction --no-ansi
222209

@@ -239,11 +226,7 @@ RUN apt-get update -qq && \
239226
apt-get clean && \
240227
rm -rf /var/lib/apt/lists/*
241228

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.
247230
COPY --from=downloader /opt/bitcoin/bin/ /usr/bin/
248231
COPY --from=downloader /opt/litecoin/bin/ /usr/bin/
249232
COPY --from=builder /tmp/lightning_install/ /usr/local/
@@ -253,6 +236,11 @@ COPY tools/docker-entrypoint.sh /entrypoint.sh
253236

254237
#TODO: user creation. user permissions on volume.
255238

239+
ENV LIGHTNINGD_DATA=/root/.lightning
240+
ENV LIGHTNINGD_RPC_PORT=9835
241+
ENV LIGHTNINGD_PORT=9735
242+
ENV LIGHTNINGD_NETWORK=bitcoin
243+
256244
EXPOSE 9735 9835
257245
VOLUME ["/root/.lightning"]
258246
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)