bitb0x/roles/apps/templates/clightning/Containerfile.j2
2024-02-13 17:45:59 -06:00

52 lines
1.9 KiB
Django/Jinja

FROM docker.io/almalinux/9-base:latest AS builder
ARG BVERSION={{bitcoin_version}}
ARG CLVERSION={{clightning_version}}
ARG BITCOIN_CORE_SIGNATURE=71A3B16735405025D447E8F274810B012346C9A6
# Update and Build clightning
RUN dnf update -y && dnf install -y epel-release \
&& dnf install -y automake autoconf python3-mako libtool clang gettext git \
gmp-devel libsq3-devel python3-devel python3-pip python3-setuptools net-tools valgrind wget zlib-devel libsodium-devel \
&& dnf clean all \
&& git clone https://github.com/ElementsProject/lightning.git && cd lightning && git checkout v$CLVERSION && ./configure && make && make install
# Download and verify bitcoin
RUN mkdir /tmp/bitcoin && cd /tmp/bitcoin
RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys ${BITCOIN_CORE_SIGNATURE} \
&& gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys F4FC70F07310028424EFC20A8E4256593F177720 \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BVERSION}/SHA256SUMS.asc \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BVERSION}/SHA256SUMS \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BVERSION}/bitcoin-${BVERSION}-x86_64-linux-gnu.tar.gz \
&& gpg --verify --status-fd 1 --verify SHA256SUMS.asc SHA256SUMS 2>/dev/null | grep "VALIDSIG" \
&& sha256sum --ignore-missing --check SHA256SUMS \
&& tar -xzvf bitcoin-${BVERSION}-x86_64-linux-gnu.tar.gz --strip=1 -C /usr/local
FROM docker.io/almalinux/9-base:latest
COPY --from=builder /usr/local/ /usr/local/
RUN dnf update -y && dnf install -y ca-certificates \
gnupg2 \
libatomic \
wget \
tar \
gzip \
shadow-utils \
python3 \
python3-setuptools \
python3-pip \
micropipenv \
&& dnf clean all && rm -fr /tmp/* /var/tmp/* \
&& cd /usr/local/libexec/c-lightning/plugins/clnrest/ && micropipenv install --method requirements
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 9735 9835
ENTRYPOINT ["/entrypoint.sh"]