Files
cdk/Dockerfile.ldk-node.arm
thesimplekid 35a4be1429 feat(docker): add LDK Node mint service with dedicated Docker setup (#1108)
* feat(docker): add LDK Node mint service with dedicated Docker setup

- Add Dockerfile.ldk-node and Dockerfile.ldk-node.arm for LDK Node builds
- Add GitHub Actions workflows for publishing LDK Node Docker images
- Add docker-compose.ldk-node.yaml for standalone LDK Node deployment
- Integrate LDK Node service into main docker-compose.yaml with profile
- Update cdk-mintd README with LDK Node Docker configuration

* feat: use docker tags
2025-09-23 14:23:06 +01:00

44 lines
1.5 KiB
Docker

# Use the official NixOS image as the base image
FROM nixos/nix:latest AS builder
# Set the working directory
WORKDIR /usr/src/app
# Copy workspace files and crates directory into the container
COPY flake.nix ./flake.nix
COPY Cargo.toml ./Cargo.toml
COPY crates ./crates
# Create a nix config file to disable syscall filtering
RUN echo 'filter-syscalls = false' > /etc/nix/nix.conf
# Start the Nix daemon and develop the environment
RUN nix develop --extra-platforms aarch64-linux --extra-experimental-features nix-command --extra-experimental-features flakes --command cargo build --release --bin cdk-mintd --features ldk-node --features prometheus --features postgres
# Create a runtime stage
FROM debian:trixie-slim
# Set the working directory
WORKDIR /usr/src/app
# Install needed runtime dependencies (if any)
RUN apt-get update && \
apt-get install -y --no-install-recommends patchelf && \
rm -rf /var/lib/apt/lists/*
# Copy the built application from the build stage
COPY --from=builder /usr/src/app/target/release/cdk-mintd /usr/local/bin/cdk-mintd
# Detect the architecture and set the interpreter accordingly
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ]; then \
patchelf --set-interpreter /lib/ld-linux-aarch64.so.1 /usr/local/bin/cdk-mintd; \
elif [ "$ARCH" = "x86_64" ]; then \
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 /usr/local/bin/cdk-mintd; \
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi
# Set the entry point for the container
CMD ["cdk-mintd"]