From be471e598f90d2c50fef0bd3127d4c0ec5975a55 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Thu, 20 Nov 2025 14:43:05 -0800 Subject: [PATCH] docker: Add vls remote_hsmd_socket binary This Dockerfile builds the VLS binaries during the builder stage and copies only the `remote_hsmd_socket` binary into the `lightningd-vls-signer` target. --- Dockerfile | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3bb550541..42f45773e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -163,7 +163,71 @@ RUN find /tmp/lightning_install -type f -executable -exec \ awk -F: '/ELF/ {print $1}' | \ xargs -r ${STRIP} --strip-unneeded -FROM base-target AS final +# VLS builder stage (only used by lightningd-vls-signer) +FROM base-builder-${TARGETOS}-${TARGETARCH} AS vls-builder + +# First declare the variables that come from parent stages +ARG target_arch +ARG target_arch_gcc +ARG target_arch_dpkg +ARG target_arch_rust +ARG COPTFLAGS + +# Then declare the tool variables using the target_arch +ARG AR=${target_arch}-ar +ARG AS=${target_arch}-as +ARG CC=${target_arch}-gcc +ARG CXX=${target_arch}-g++ +ARG LD=${target_arch}-ld +ARG STRIP=${target_arch}-strip +ARG TARGET=${target_arch_rust} +ARG RUST_PROFILE=release +ARG VERSION +ARG VLS_VERSION=v0.14.0 + +# Install cross-compilation toolchain (same as builder stage) +RUN dpkg --add-architecture ${target_arch_dpkg} + +RUN apt-get update && \ + apt-get install -qq -y --no-install-recommends \ + pkg-config:${target_arch_dpkg} \ + crossbuild-essential-${target_arch_dpkg} && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}" +ENV PKG_CONFIG_PATH=/usr/lib/${target_arch}/pkgconfig +ENV PKG_CONFIG_LIBDIR=/usr/lib/${target_arch}/pkgconfig + +WORKDIR /opt + +RUN ./install-uv.sh -q +RUN ./install-rust.sh -y -q --profile minimal --component rustfmt --target ${target_arch_rust} + +RUN git clone --depth 1 --branch ${VLS_VERSION} https://gitlab.com/lightning-signer/validating-lightning-signer.git +WORKDIR /opt/validating-lightning-signer + +RUN mkdir -p .cargo && tee .cargo/config.toml <