Skip to content

Commit b2d2693

Browse files
committed
feat(images): add support for Core Lightning v24.05
1 parent 8e83ba7 commit b2d2693

File tree

5 files changed

+13
-184
lines changed

5 files changed

+13
-184
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ With Polar you can:
3838
Supported Network Node Versions:
3939

4040
- [LND](https://github.com/lightningnetwork/lnd) - v0.18.0, v0.17.5, v0.17.4, v0.17.3, v0.17.2, v0.17.1, v0.17.0, v0.16.4, v0.16.2, v0.16.1, v0.16.0, v0.15.5, v0.14.3, v0.13.1
41-
- [Core Lightning](https://github.com/ElementsProject/lightning) - v24.02.2, v23.11.2
41+
- [Core Lightning](https://github.com/ElementsProject/lightning) - v24.05, v24.02.2, v23.11.2
4242
- [Eclair](https://github.com/ACINQ/eclair/) - v0.10.0, v0.9.0, v0.8.0, v0.7.0, v0.6.2, v0.5.0
4343
- [Bitcoin Core](https://github.com/bitcoin/bitcoin) - v27.0, v26.0, v25.0, v24.0, v23.0, v22.0, v0.21.1
4444
- [Taproot Assets](https://github.com/lightninglabs/taproot-assets) - v0.3.3, v0.3.2

RELEASE.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This document describes the steps to follow to create a new release of Polar and
1919
1. Modify the `README.md` file
2020
- add any updates to features and/or newly supported node versions
2121
- update the download links to point to the new urls
22+
1. Update the [docker/nodes.json](./docker/nodes.json) file to mirror the `defaultRepoState` var in [src/utils/constants.ts](./src/utils/constants.ts)
2223
1. Commit your changes
2324
```
2425
git add .

docker/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Replace `<version>` with the desired LND version (ex: `0.7.1-beta`)
9797

9898
### Tags
9999

100+
- `24.05` ([clightning/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/clightning/Dockerfile))
100101
- `24.02.2` ([clightning/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/clightning/Dockerfile))
101102
- `23.11.2` ([clightning/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/clightning/Dockerfile))
102103
- `23.05.2` ([clightning/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/clightning/Dockerfile))

docker/clightning/Dockerfile

+8-181
Original file line numberDiff line numberDiff line change
@@ -1,192 +1,20 @@
1-
#########################
2-
# Polar needs c-lightning compiled with the DEVELOPER=1 flag in order to decrease the
3-
# normal 30 second bitcoind poll interval using the argument --dev-bitcoind-poll=<seconds>.
4-
# When running in regtest, we want to be able to mine blocks and confirm transactions instantly.
5-
# Original Source: https://github.com/ElementsProject/lightning/blob/v24.02.2/Dockerfile
6-
#########################
7-
8-
#########################
9-
# BEGIN ElementsProject/lightning/Dockerfile
10-
#########################
11-
12-
# This dockerfile is meant to compile a core-lightning x64 image
13-
# It is using multi stage build:
14-
# * downloader: Download litecoin/bitcoin and qemu binaries needed for core-lightning
15-
# * builder: Compile core-lightning dependencies, then core-lightning itself with static linking
16-
# * final: Copy the binaries required at runtime
17-
# The resulting image uploaded to dockerhub will only contain what is needed for runtime.
18-
# From the root of the repository, run "docker build -t yourimage:yourtag ."
19-
FROM debian:bullseye-slim as downloader
20-
21-
RUN set -ex \
22-
&& apt-get update \
23-
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr wget
24-
25-
WORKDIR /opt
26-
27-
28-
ARG BITCOIN_VERSION=22.0
29-
ARG TARBALL_ARCH=x86_64-linux-gnu
30-
ENV TARBALL_ARCH_FINAL=$TARBALL_ARCH
31-
ENV BITCOIN_TARBALL bitcoin-${BITCOIN_VERSION}-${TARBALL_ARCH_FINAL}.tar.gz
32-
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/$BITCOIN_TARBALL
33-
ENV BITCOIN_ASC_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/SHA256SUMS
34-
35-
RUN mkdir /opt/bitcoin && cd /opt/bitcoin \
36-
#################### Polar Modification
37-
# We want to use the base image arch instead of the BUILDARG above so we can build the
38-
# multi-arch image with one command:
39-
# "docker buildx build --platform linux/amd64,linux/arm64 ..."
40-
####################
41-
&& TARBALL_ARCH_FINAL="$(uname -m)-linux-gnu" \
42-
&& BITCOIN_TARBALL=bitcoin-${BITCOIN_VERSION}-${TARBALL_ARCH_FINAL}.tar.gz \
43-
&& BITCOIN_URL=https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/$BITCOIN_TARBALL \
44-
&& BITCOIN_ASC_URL=https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/SHA256SUMS \
45-
####################
46-
&& wget -qO $BITCOIN_TARBALL "$BITCOIN_URL" \
47-
&& wget -qO bitcoin "$BITCOIN_ASC_URL" \
48-
&& grep $BITCOIN_TARBALL bitcoin | tee SHA256SUMS \
49-
&& sha256sum -c SHA256SUMS \
50-
&& BD=bitcoin-$BITCOIN_VERSION/bin \
51-
&& tar -xzvf $BITCOIN_TARBALL $BD/ --strip-components=1 \
52-
&& rm $BITCOIN_TARBALL
53-
54-
ENV LITECOIN_VERSION 0.16.3
55-
ENV LITECOIN_URL https://download.litecoin.org/litecoin-${LITECOIN_VERSION}/linux/litecoin-${LITECOIN_VERSION}-${TARBALL_ARCH_FINAL}.tar.gz
56-
57-
# install litecoin binaries
58-
RUN mkdir /opt/litecoin && cd /opt/litecoin \
59-
&& wget -qO litecoin.tar.gz "$LITECOIN_URL" \
60-
&& tar -xzvf litecoin.tar.gz litecoin-$LITECOIN_VERSION/bin/litecoin-cli --strip-components=1 --exclude=*-qt \
61-
&& rm litecoin.tar.gz
62-
63-
FROM debian:bullseye-slim as builder
64-
65-
ENV LIGHTNINGD_VERSION=master
66-
RUN apt-get update -qq && \
67-
apt-get install -qq -y --no-install-recommends \
68-
autoconf \
69-
automake \
70-
build-essential \
71-
ca-certificates \
72-
curl \
73-
dirmngr \
74-
gettext \
75-
git \
76-
gnupg \
77-
libpq-dev \
78-
libtool \
79-
libffi-dev \
80-
pkg-config \
81-
libssl-dev \
82-
protobuf-compiler \
83-
python3.9 \
84-
python3-dev \
85-
python3-mako \
86-
python3-pip \
87-
python3-venv \
88-
python3-setuptools \
89-
libev-dev \
90-
libevent-dev \
91-
qemu-user-static \
92-
wget \
93-
jq
94-
95-
RUN wget -q https://zlib.net/fossils/zlib-1.2.13.tar.gz \
96-
&& tar xvf zlib-1.2.13.tar.gz \
97-
&& cd zlib-1.2.13 \
98-
&& ./configure \
99-
&& make \
100-
&& make install && cd .. && \
101-
rm zlib-1.2.13.tar.gz && \
102-
rm -rf zlib-1.2.13
103-
104-
RUN apt-get install -y --no-install-recommends unzip tclsh \
105-
&& wget -q https://www.sqlite.org/2019/sqlite-src-3290000.zip \
106-
&& unzip sqlite-src-3290000.zip \
107-
&& cd sqlite-src-3290000 \
108-
&& ./configure --enable-static --disable-readline --disable-threadsafe --disable-load-extension \
109-
&& make \
110-
&& make install && cd .. && rm sqlite-src-3290000.zip && rm -rf sqlite-src-3290000
111-
112-
USER root
113-
ENV RUST_PROFILE=release
114-
ENV PATH=$PATH:/root/.cargo/bin/
115-
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
116-
RUN rustup toolchain install stable --component rustfmt --allow-downgrade
117-
118-
WORKDIR /opt/lightningd
119-
#################### Polar Modification
120-
# Pull source code from github instead of a local repo
121-
# Original lines:
122-
# COPY . /tmp/lightning
123-
# RUN git clone --recursive /tmp/lightning . && \
124-
# git checkout $(git --work-tree=/tmp/lightning --git-dir=/tmp/lightning/.git rev-parse HEAD)
1251
ARG CLN_VERSION
126-
RUN git clone --recursive --branch=v${CLN_VERSION} https://github.com/ElementsProject/lightning .
127-
####################
128-
129-
ENV PYTHON_VERSION=3
130-
RUN curl -sSL https://install.python-poetry.org | python3 -
131-
132-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
133-
134-
RUN pip3 install --upgrade pip setuptools wheel
135-
RUN pip3 wheel cryptography
136-
RUN pip3 install grpcio-tools
137-
138-
RUN /root/.local/bin/poetry export -o requirements.txt --without-hashes --with dev
139-
RUN pip3 install -r requirements.txt
140-
141-
RUN ./configure --prefix=/tmp/lightning_install --enable-static && \
142-
make && \
143-
/root/.local/bin/poetry run make install
144-
145-
FROM debian:bullseye-slim as final
2+
ARG CLN_IMAGE="elementsproject/lightningd:v${CLN_VERSION}"
1463

147-
RUN apt-get update && \
148-
apt-get install -y --no-install-recommends \
149-
tini \
150-
socat \
151-
inotify-tools \
152-
python3.9 \
153-
python3-pip \
154-
qemu-user-static \
155-
libpq5 && \
156-
apt-get clean && \
157-
rm -rf /var/lib/apt/lists/*
4+
FROM ${CLN_IMAGE}
1585

159-
ENV LIGHTNINGD_DATA=/root/.lightning
160-
ENV LIGHTNINGD_RPC_PORT=9835
161-
ENV LIGHTNINGD_PORT=9735
162-
ENV LIGHTNINGD_NETWORK=bitcoin
163-
164-
RUN mkdir $LIGHTNINGD_DATA && \
165-
touch $LIGHTNINGD_DATA/config
166-
VOLUME [ "/root/.lightning" ]
167-
168-
COPY --from=builder /tmp/lightning_install/ /usr/local/
169-
COPY --from=builder /usr/local/lib/python3.9/dist-packages/ /usr/local/lib/python3.9/dist-packages/
170-
COPY --from=downloader /opt/bitcoin/bin /usr/bin
171-
COPY --from=downloader /opt/litecoin/bin /usr/bin
172-
#################### Polar Modification
173-
# This line is removed as we have our own entrypoint file
174-
# Original line:
175-
# COPY tools/docker-entrypoint.sh entrypoint.sh
176-
####################
177-
178-
#########################
179-
# END ElementsProject/lightning/Dockerfile
180-
#########################
181-
182-
COPY --from=builder /opt/lightningd/contrib/lightning-cli.bash-completion /etc/bash_completion.d/
6+
ARG CLN_VERSION
1837

184-
# install nodejs
8+
# install gosu
1859
RUN apt-get update -y \
18610
&& apt-get install -y curl gosu git \
18711
&& apt-get clean \
18812
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
18913

14+
# download CLN bash completion file
15+
RUN curl -SLO https://raw.githubusercontent.com/ElementsProject/lightning/v${CLN_VERSION}/contrib/lightning-cli.bash-completion \
16+
&& mv lightning-cli.bash-completion /etc/bash_completion.d/lightning-cli
17+
19018
# install lightning-cli bash completion
19119
RUN curl -SLO https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion \
19220
&& mv bash_completion /usr/share/bash-completion/
@@ -197,7 +25,6 @@ COPY bashrc /home/clightning/.bashrc
19725
RUN chmod a+x /entrypoint.sh
19826

19927
VOLUME ["/home/clightning"]
200-
VOLUME ["/opt/c-lightning-rest/certs"]
20128

20229
EXPOSE 9735 9835 8080 10000
20330

src/utils/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ export const defaultRepoState: DockerRepoState = {
296296
},
297297
},
298298
'c-lightning': {
299-
latest: '24.02.2',
300-
versions: ['24.02.2', '23.11.2'],
299+
latest: '24.05',
300+
versions: ['24.05', '24.02.2', '23.11.2'],
301301
},
302302
eclair: {
303303
latest: '0.10.0',

0 commit comments

Comments
 (0)