Files
palladum-lightning/Dockerfile.palladium-lightning

99 lines
3.3 KiB
Docker
Raw Permalink Normal View History

# syntax=docker/dockerfile:1.7-labs
# Palladium Lightning — production image (amd64, no cross-compilation, no Rust plugins)
# ──────────────────────────────────────────────────────────────────────────────
# Stage 1: builder
# ──────────────────────────────────────────────────────────────────────────────
FROM ubuntu:22.04 AS builder
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
gcc \
git \
gettext \
jq \
libffi-dev \
libicu-dev \
libprotobuf-c-dev \
libsodium-dev \
libsqlite3-dev \
libssl-dev \
libtool \
pkg-config \
protobuf-compiler \
python3-dev \
zlib1g-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /opt/lightningd
# Copy source (excluding .git, added back below for submodule init)
COPY --exclude=.git/ . .
COPY .git/ .git/
RUN git submodule update --init --recursive --depth 1 --jobs "$(nproc)"
RUN ./configure \
--prefix=/tmp/lightning_install \
--disable-valgrind \
--disable-compat
RUN make install-program -j"$(nproc)"
# Strip debug symbols to reduce image size
RUN find /tmp/lightning_install -type f -executable \
-exec sh -c 'file "$1" | grep -q ELF && strip --strip-unneeded "$1"' _ {} \;
# ──────────────────────────────────────────────────────────────────────────────
# Stage 2: runtime
# ──────────────────────────────────────────────────────────────────────────────
FROM ubuntu:22.04 AS lightningd
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
inotify-tools \
jq \
libffi8 \
libicu70 \
libsodium23 \
libsqlite3-0 \
socat && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# palladium-cli is needed by the bcli plugin to talk to palladiumd.
# Copy it from the already-built palladium-node image so we don't duplicate binaries.
# Build palladium-node:local first: docker compose -f docker-compose.yml build
COPY --from=palladium-node:local /usr/local/bin/palladium-cli /usr/local/bin/palladium-cli
# Lightning binaries and plugins
COPY --from=builder /tmp/lightning_install/ /usr/local/
COPY tools/docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV LIGHTNINGD_DATA=/root/.lightning
ENV LIGHTNINGD_NETWORK=palladium
ENV LIGHTNINGD_PORT=9735
ENV LIGHTNINGD_RPC_PORT=9835
ENV EXPOSE_TCP=false
EXPOSE 9735
VOLUME ["/root/.lightning"]
ENTRYPOINT ["/entrypoint.sh"]