forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script: Add reproducible build script for Ubuntu v24.04
This PR will help in publishing CLN reproducible binaries for Ubuntu v24.04 (noble). Please note that I adjusted Dockerfiles for focal and jammy also to keep the base image creation script same for all three images. The step update was required because `noble` only runs with ubuntu:noble setup. Changelog-None.
- Loading branch information
1 parent
fbd454b
commit 3dc6e6d
Showing
7 changed files
with
114 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ plugins/cln-grpc | |
bionic/ | ||
focal/ | ||
jammy/ | ||
noble/ | ||
release/ | ||
.vscode/ | ||
.cache/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
FROM ubuntu:noble | ||
|
||
ENV TZ=UTC | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
ENV RUST_PROFILE=release | ||
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:$PATH | ||
ENV PROTOC_VERSION=22.0 | ||
|
||
RUN sed -i '/updates/d' /etc/apt/sources.list && \ | ||
sed -i '/security/d' /etc/apt/sources.list | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
autoconf \ | ||
build-essential \ | ||
ca-certificates \ | ||
file \ | ||
gettext \ | ||
git \ | ||
curl \ | ||
libsqlite3-dev \ | ||
libpq-dev \ | ||
libsodium23 \ | ||
libtool \ | ||
m4 \ | ||
sudo \ | ||
unzip \ | ||
wget \ | ||
jq \ | ||
zip | ||
|
||
# Configure /repo/.git as 'safe.directory' | ||
RUN git config --global --add safe.directory /repo/.git | ||
|
||
# Install Python3.10 (more reproducible than relying on python3-setuptools) | ||
RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \ | ||
apt-get install -y --no-install-recommends \ | ||
libbz2-dev \ | ||
libffi-dev \ | ||
libreadline-dev \ | ||
libssl-dev \ | ||
zlib1g-dev && \ | ||
pyenv install 3.10.0 && \ | ||
pyenv global 3.10.0 | ||
|
||
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \ | ||
&& rm /tmp/get-pip.py \ | ||
&& pip install poetry | ||
|
||
RUN wget https://sh.rustup.rs -O rustup-install.sh && \ | ||
bash rustup-install.sh --default-toolchain none --quiet -y && \ | ||
rm rustup-install.sh && \ | ||
/root/.cargo/bin/rustup install 1.73 | ||
|
||
# Download protoc manually, it is in the update repos which we | ||
# disabled above, so `apt-get` can't find it anymore. | ||
RUN cd /tmp/ && \ | ||
wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ | ||
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ | ||
mv bin/protoc /usr/local/bin && \ | ||
rm -rf include bin protoc-${PROTOC_VERSION}-linux-x86_64.zip | ||
|
||
RUN mkdir /build | ||
WORKDIR /build | ||
|
||
# We mount the repo into `/repo` and then we take a snapshot of it | ||
# first by cloning it. This ensures we're not including any | ||
# uncommitted changes in the working directory on the host. Notice | ||
# that we no longer take the zipfile. | ||
CMD git clone /repo . \ | ||
&& poetry export -o requirements.txt --without-hashes \ | ||
&& pip install -r requirements.txt \ | ||
&& tools/repro-build.sh \ | ||
&& cp *.xz /repo/release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters