Skip to content

Commit 0707ffc

Browse files
reprobuild: use pyenv for python installation
python-setuptools installation was flakey on some systems. Installing with pyenv should provide a more reproducible build. Changelog-None
1 parent c7fd13a commit 0707ffc

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

contrib/reprobuild/Dockerfile.focal

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM focal
33
ENV TZ=UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
55
ENV RUST_PROFILE=release
6-
ENV PATH=/root/.cargo/bin:$PATH
6+
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:$PATH
77
ENV PROTOC_VERSION=22.0
88

99
RUN sed -i '/updates/d' /etc/apt/sources.list && \
@@ -22,12 +22,23 @@ RUN apt-get update \
2222
libsodium23 \
2323
libtool \
2424
m4 \
25-
python3-setuptools \
2625
sudo \
2726
unzip \
2827
wget \
2928
zip
3029

30+
# install Python3.8 (more reproducible than relying on python3-setuptools)
31+
RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \
32+
apt-get install -y --no-install-recommends \
33+
libbz2-dev \
34+
libffi-dev \
35+
libreadline-dev \
36+
libsqlite3-dev \
37+
libssl-dev \
38+
zlib1g-dev && \
39+
pyenv install 3.8.0 && \
40+
pyenv global 3.8.0
41+
3142
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \
3243
&& rm /tmp/get-pip.py \
3344
&& pip install poetry

contrib/reprobuild/Dockerfile.jammy

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM jammy
33
ENV TZ=UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
55
ENV RUST_PROFILE=release
6-
ENV PATH=/root/.cargo/bin:$PATH
6+
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:$PATH
77
ENV PROTOC_VERSION=22.0
88

99
RUN sed -i '/updates/d' /etc/apt/sources.list && \
@@ -23,12 +23,23 @@ RUN apt-get update \
2323
libsodium23 \
2424
libtool \
2525
m4 \
26-
python3-setuptools \
2726
sudo \
2827
unzip \
2928
wget \
3029
zip
3130

31+
# Install Python3.10 (more reproducible than relying on python3-setuptools)
32+
RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \
33+
apt-get install -y --no-install-recommends \
34+
libbz2-dev \
35+
libffi-dev \
36+
libreadline-dev \
37+
libsqlite3-dev \
38+
libssl-dev \
39+
zlib1g-dev && \
40+
pyenv install 3.10.0 && \
41+
pyenv global 3.10.0
42+
3243
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \
3344
&& rm /tmp/get-pip.py \
3445
&& pip install poetry

0 commit comments

Comments
 (0)