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:
parent
182c900cea
commit
f40b6da457
|
@ -7,36 +7,52 @@ RUN sed -i '/updates/d' /etc/apt/sources.list && \
|
||||||
sed -i '/security/d' /etc/apt/sources.list
|
sed -i '/security/d' /etc/apt/sources.list
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
sudo \
|
sudo \
|
||||||
build-essential \
|
build-essential \
|
||||||
libsodium23 \
|
libsodium23 \
|
||||||
python3-setuptools \
|
libpq-dev \
|
||||||
libpq-dev \
|
git \
|
||||||
git \
|
file \
|
||||||
file \
|
autoconf \
|
||||||
autoconf \
|
debianutils \
|
||||||
debianutils \
|
gettext \
|
||||||
gettext \
|
zip \
|
||||||
zip \
|
unzip \
|
||||||
unzip \
|
wget
|
||||||
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 \
|
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \
|
||||||
&& rm /tmp/get-pip.py \
|
&& rm /tmp/get-pip.py \
|
||||||
&& pip install mrkd mako
|
&& pip install poetry
|
||||||
|
|
||||||
RUN mkdir /build
|
RUN mkdir /build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
CMD git clone /repo /build \
|
CMD git clone /repo /build \
|
||||||
&& tools/build-release.sh zipfile \
|
&& poetry export -o requirements.txt --without-hashes \
|
||||||
&& mkdir -p /repro \
|
&& pip install -r requirements.txt\
|
||||||
&& cd /repro \
|
&& tools/build-release.sh zipfile \
|
||||||
&& unzip /build/release/*.zip \
|
&& mkdir -p /repro \
|
||||||
&& cd clightning* \
|
&& cd /repro \
|
||||||
&& tools/repro-build.sh \
|
&& unzip /build/release/*.zip \
|
||||||
&& cp *.xz /build/release/* /repo/release/ \
|
&& cd clightning* \
|
||||||
&& cd /repo/release \
|
&& tools/repro-build.sh \
|
||||||
&& sha256sum *
|
&& cp *.xz /build/release/* /repo/release/ \
|
||||||
|
&& cd /repo/release \
|
||||||
|
&& sha256sum *
|
||||||
|
|
|
@ -26,19 +26,22 @@ RUN apt-get update \
|
||||||
zip
|
zip
|
||||||
|
|
||||||
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \
|
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \
|
||||||
&& rm /tmp/get-pip.py \
|
&& rm /tmp/get-pip.py \
|
||||||
&& pip install mrkd mako
|
&& pip install poetry
|
||||||
|
|
||||||
RUN mkdir /build
|
RUN mkdir /build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
CMD git clone /repo /build \
|
CMD git clone /repo /build \
|
||||||
|
&& poetry export -o requirements.txt --without-hashes \
|
||||||
|
&& pip install -r requirements.txt \
|
||||||
&& tools/build-release.sh zipfile \
|
&& tools/build-release.sh zipfile \
|
||||||
&& mkdir -p /repro \
|
&& mkdir -p /repro \
|
||||||
&& cd /repro \
|
&& cd /repro \
|
||||||
&& unzip /build/release/*.zip \
|
&& unzip /build/release/*.zip \
|
||||||
&& cd clightning* \
|
&& cd clightning* \
|
||||||
&& tools/repro-build.sh \
|
&& tools/repro-build.sh \
|
||||||
|
&& mkdir -p /repo/release \
|
||||||
&& cp *.xz /build/release/* /repo/release/ \
|
&& cp *.xz /build/release/* /repo/release/ \
|
||||||
&& cd /repo/release/ \
|
&& cd /repo/release/ \
|
||||||
&& sha256sum *
|
&& sha256sum *
|
||||||
|
|
|
@ -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 *
|
|
@ -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
|
packages (wrongly updated packages depending on the versions not available in
|
||||||
the non-updated repos).
|
the non-updated repos).
|
||||||
|
|
||||||
The following will create that base image:
|
The following table lists the codenames of distributions that we
|
||||||
|
currently support:
|
||||||
```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:
|
|
||||||
|
|
||||||
| Distribution Version | Codename |
|
| Distribution Version | Codename |
|
||||||
|----------------------|----------|
|
|----------------------|----------|
|
||||||
| Ubuntu 18.04 | bionic |
|
| Ubuntu 18.04 | bionic |
|
||||||
| Ubuntu 20.04 | focal |
|
| Ubuntu 20.04 | focal |
|
||||||
|
| Ubuntu 22.04 | jammy |
|
||||||
|
|
||||||
Notice that you migh not have `debootstrap` manifests for versions newer than
|
Depending on your host OS release you migh not have `debootstrap`
|
||||||
your host OS. If one of the `debootstrap` command above complains about a
|
manifests for versions newer than your host OS. Due to this we run the
|
||||||
script not existing you might need to run `debootstrap` in a docker container
|
`debootstrap` commands in a container of the latest version itself:
|
||||||
itself:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo docker run --rm -v $(pwd):/build ubuntu:20.04 \
|
for v in bionic focal jammy; do
|
||||||
bash -c "apt update && apt-get install -y debootstrap && debootstrap focal /build/focal"
|
echo "Building base image for $v"
|
||||||
sudo tar -C focal -c . | sudo docker import - focal
|
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:
|
Verify that the image corresponds to our expectation and is runnable:
|
||||||
|
|
Loading…
Reference in New Issue