Skip to content

Commit 9f75c99

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
docker: Dockerfile fixes after poetry to uv migration
Cargo utilizes `git ls-remote` to resolve git dependencies specified by commit hashes. GitHub only advertises commits that are reachable from branches, tags, or PR references. The `bip353-plugin` was referencing an orphaned commit in the `bitcoin-payment-instructions` dependency that was unreachable through any advertised reference. This can be resolved by installing the tarball release v0.5.0. Changelog-None.
1 parent 49c2f29 commit 9f75c99

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ RUN apt-get update -qq && \
9090

9191
ENV PATH="/root/.local/bin:$PATH" \
9292
PYTHON_VERSION=3
93-
RUN wget -qO- https://astral.sh/uv/install.sh | sh && \
94-
&& uv sync --all-extras --all-groups
9593

9694
RUN wget -q https://zlib.net/fossils/zlib-1.2.13.tar.gz -O zlib.tar.gz && \
9795
wget -q https://www.sqlite.org/2019/sqlite-src-3290000.zip -O sqlite.zip && \
@@ -102,7 +100,9 @@ COPY . /tmp/lightning
102100
RUN git clone --recursive /tmp/lightning . && \
103101
git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)
104102

105-
# Do not build python plugins here, python doesn't support cross compilation.
103+
RUN wget -qO- https://astral.sh/uv/install.sh | sh && \
104+
uv sync --all-extras --all-groups
105+
106106
WORKDIR /
107107

108108
FROM base-builder AS base-builder-linux-amd64
@@ -202,6 +202,10 @@ RUN mkdir /var/libpq && cp -a "$(${PG_CONFIG} --libdir)"/libpq.* /var/libpq
202202

203203
ENV RUST_PROFILE=release \
204204
PATH="/root/.cargo/bin:/root/.local/bin:$PATH"
205+
ENV UV_CACHE_DIR=/tmp/uv-cache
206+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
207+
ENV CARGO_NET_GIT_FETCH_WITH_CLI_ALWAYS=true
208+
205209
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ${RUSTUP_INSTALL_OPTS}
206210
RUN rustup toolchain install stable --component rustfmt --allow-downgrade
207211

@@ -218,14 +222,11 @@ RUN ( ! [ "${target_host}" = "arm-linux-gnueabihf" ] ) || \
218222

219223
# Ensure that git differences are removed before making bineries, to avoid `-modded` suffix
220224
RUN git reset --hard HEAD
221-
222225
RUN ./configure --prefix=/tmp/lightning_install --enable-static && uv run make install
223226

224227
WORKDIR /opt/lightningd
225228
RUN echo 'RUSTUP_INSTALL_OPTS="${RUSTUP_INSTALL_OPTS}"' > /tmp/rustup_install_opts.txt
226229

227-
# Copy rustup_install_opts.txt file from builder
228-
COPY --from=builder /tmp/rustup_install_opts.txt /tmp/rustup_install_opts.txt
229230
# Setup ENV $RUSTUP_INSTALL_OPTS for this stage
230231
RUN export $(cat /tmp/rustup_install_opts.txt)
231232
ENV PATH="/root/.cargo/bin:/root/.venvs/cln/bin:$PATH"
@@ -241,7 +242,7 @@ RUN apt-get update && \
241242
socat \
242243
inotify-tools \
243244
jq \
244-
python3 \
245+
python3 && \
245246
apt-get clean && \
246247
rm -rf /var/lib/apt/lists/*
247248

@@ -262,7 +263,6 @@ RUN --mount=type=bind,from=builder,source=/var/libpq,target=/var/libpq,rw \
262263
ldconfig
263264

264265
COPY --from=builder /tmp/lightning_install/ /usr/local/
265-
COPY --from=builder-python /root/.venvs/cln/lib/python3.11/site-packages /usr/local/lib/python3.11/dist-packages/
266266
COPY --from=downloader /opt/bitcoin/bin /usr/bin
267267
COPY --from=downloader /opt/litecoin/bin /usr/bin
268268
COPY tools/docker-entrypoint.sh entrypoint.sh

plugins/bip353-plugin/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ log-panics = "2"
1919

2020
cln-plugin = { version = "0.5", path = "../../plugins" }
2121

22-
bitcoin-payment-instructions = { git = "https://github.com/rust-bitcoin/bitcoin-payment-instructions.git", rev = "d071ce27734ca13be2471f81abf8699d902c3a10", features = [
23-
"http",
24-
] }
22+
bitcoin-payment-instructions = { version = "0.5.0", features = ["http"] }
2523

2624
reqwest = { version = "0.11", default-features = false, features = [
2725
"rustls-tls",

0 commit comments

Comments
 (0)