Skip to content

Commit 16d72f6

Browse files
author
Claudio Raimondi
committed
Fix git inclusion [skip ci]
1 parent 5582fd1 commit 16d72f6

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
Dockerfile
22
contrib/docker/Dockerfile.*
3-
target
4-
.git/
3+
target

Dockerfile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
13
FROM --platform=${BUILDPLATFORM} debian:bookworm-slim AS base-host
24

35
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
@@ -67,6 +69,7 @@ RUN apt-get update && \
6769
build-essential \
6870
ca-certificates \
6971
wget \
72+
git \
7073
python3-dev \
7174
autoconf \
7275
automake \
@@ -88,7 +91,7 @@ ADD --chmod=750 https://sh.rustup.rs install-rust.sh
8891

8992
WORKDIR /opt/lightningd
9093

91-
COPY . .
94+
COPY --exclude=.git/ . .
9295

9396
FROM base-builder AS base-builder-linux-amd64
9497

@@ -155,12 +158,13 @@ linker = "${target_arch}-gcc"
155158
rustflags = ["-C", "target-cpu=generic"]
156159
EOF
157160

158-
#TODO: ensure Makefile compiles using CPU dependent intrinsics (avx/sse/march=native). see issue (https://github.com/ElementsProject/lightning/issues/8456). COPTFLAGS
159-
RUN ./configure --enable-static --disable-compat --disable-valgrind
160-
#TODO: Fix: .git needed by makefile for git --describe
161-
RUN uv run make -j$(nproc) lightningd/lightningd
161+
#TODO: maybe only compile lightningd? instead of all the plugins as well
162+
RUN ./configure --prefix=/opt/lightningd --enable-static --disable-compat --disable-valgrind
163+
COPY .git/ .git/
164+
RUN git submodule update --init --recursive
165+
RUN uv run make -j$(nproc) install
162166

163-
RUN ${STRIP} --strip-unneeded lightningd/lightningd
167+
RUN ${STRIP} --strip-unneeded bin/lightningd
164168

165169
FROM base-target AS final
166170

@@ -173,9 +177,9 @@ RUN apt-get update && \
173177
apt-get clean && \
174178
rm -rf /var/lib/apt/lists/*
175179

176-
COPY --from=downloader /opt/bitcoin/bin/bitcoin-cli /usr/bin/
177-
COPY --from=downloader /opt/litecoin/bin/litecoin-cli /usr/bin/
178-
COPY --from=builder /opt/lightningd/lightningd/lightningd /usr/local/bin/
180+
COPY --from=downloader /opt/bitcoin/bin/bitcoin-cli /usr/bin/
181+
COPY --from=downloader /opt/litecoin/bin/litecoin-cli /usr/bin/
182+
COPY --from=builder /opt/lightningd/bin/lightningd /usr/local/bin/
179183

180184
COPY tools/docker-entrypoint.sh /entrypoint.sh
181185

0 commit comments

Comments
 (0)