repro: Update repro dockerfiles and instructions

Switching to poetry, and deprecating python 3.6, made things a bit
more tricky. Sadly we'll not be able to build jammy, as its support is
missing in the tag tarball, but it'll be there for the next release.
This commit is contained in:
Christian Decker 2022-04-25 18:23:18 +02:00 committed by Rusty Russell
parent 182c900cea
commit f40b6da457
4 changed files with 105 additions and 43 deletions

View File

@ -7,36 +7,52 @@ 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 \
&& apt-get install -y --no-install-recommends \
ca-certificates \
sudo \
build-essential \
libsodium23 \
python3-setuptools \
libpq-dev \
git \
file \
autoconf \
debianutils \
gettext \
zip \
unzip \
wget
sudo \
build-essential \
libsodium23 \
libpq-dev \
git \
file \
autoconf \
debianutils \
gettext \
zip \
unzip \
wget
# Need to fetch a python version that is >= 3.7 since that's the
# lowest version supported by pyln. This is just temporary until we
# drop support for ubuntu 18.04
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:$PATH
RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv \
&& apt-get install -y --no-install-recommends \
libbz2-dev \
libffi-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
zlib1g-dev \
&& pyenv install 3.7.0 \
&& pyenv global 3.7.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 mrkd mako
&& pip install poetry
RUN mkdir /build
WORKDIR /build
CMD git clone /repo /build \
&& tools/build-release.sh zipfile \
&& mkdir -p /repro \
&& cd /repro \
&& unzip /build/release/*.zip \
&& cd clightning* \
&& tools/repro-build.sh \
&& cp *.xz /build/release/* /repo/release/ \
&& cd /repo/release \
&& sha256sum *
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt\
&& tools/build-release.sh zipfile \
&& mkdir -p /repro \
&& cd /repro \
&& unzip /build/release/*.zip \
&& cd clightning* \
&& tools/repro-build.sh \
&& cp *.xz /build/release/* /repo/release/ \
&& cd /repo/release \
&& sha256sum *

View File

@ -26,19 +26,22 @@ RUN apt-get update \
zip
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 mrkd mako
&& rm /tmp/get-pip.py \
&& pip install poetry
RUN mkdir /build
WORKDIR /build
CMD git clone /repo /build \
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt \
&& tools/build-release.sh zipfile \
&& mkdir -p /repro \
&& cd /repro \
&& unzip /build/release/*.zip \
&& cd clightning* \
&& tools/repro-build.sh \
&& tools/repro-build.sh \
&& mkdir -p /repo/release \
&& cp *.xz /build/release/* /repo/release/ \
&& cd /repo/release/ \
&& sha256sum *

View File

@ -0,0 +1,47 @@
FROM jammy
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
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 \
libgmp-dev \
libpq-dev \
libsodium23 \
libtool \
m4 \
python3-setuptools \
sudo \
unzip \
wget \
zip
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 mkdir /build
WORKDIR /build
CMD git clone /repo /build \
&& poetry export -o requirements.txt --without-hashes \
&& pip install -r requirements.txt \
&& tools/build-release.sh zipfile \
&& mkdir -p /repro \
&& cd /repro \
&& unzip /build/release/*.zip \
&& cd clightning* \
&& tools/repro-build.sh \
&& mkdir -p /repo/release \
&& cp *.xz /build/release/* /repo/release/ \
&& cd /repo/release/ \
&& sha256sum *

View File

@ -66,30 +66,26 @@ latter means that if we disable the `updates` and `security` repositories for
packages (wrongly updated packages depending on the versions not available in
the non-updated repos).
The following will create that base image:
```bash
sudo debootstrap bionic bionic
sudo tar -C bionic -c . | sudo docker import - bionic
```
`bionic` in this case is the codename for Ubuntu 18.04 LTS. The following
table lists the codenames of distributions that we currently support:
The following table lists the codenames of distributions that we
currently support:
| Distribution Version | Codename |
|----------------------|----------|
| Ubuntu 18.04 | bionic |
| Ubuntu 20.04 | focal |
| Ubuntu 22.04 | jammy |
Notice that you migh not have `debootstrap` manifests for versions newer than
your host OS. If one of the `debootstrap` command above complains about a
script not existing you might need to run `debootstrap` in a docker container
itself:
Depending on your host OS release you migh not have `debootstrap`
manifests for versions newer than your host OS. Due to this we run the
`debootstrap` commands in a container of the latest version itself:
```bash
sudo docker run --rm -v $(pwd):/build ubuntu:20.04 \
bash -c "apt update && apt-get install -y debootstrap && debootstrap focal /build/focal"
sudo tar -C focal -c . | sudo docker import - focal
for v in bionic focal jammy; do
echo "Building base image for $v"
sudo docker run --rm -v $(pwd):/build ubuntu:22.04 \
bash -c "apt-get update && apt-get install -y debootstrap && debootstrap $v /build/$v"
sudo tar -C $v -c . | sudo docker import - $v
done
```
Verify that the image corresponds to our expectation and is runnable: