This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new a60affe3a [mesos-build] Fix python setup in Dockerfiles.
a60affe3a is described below

commit a60affe3af6e053b8ecf7fcfa3c11076e9bdc333
Author: None <None>
AuthorDate: Wed May 29 12:12:31 2024 -0400

    [mesos-build] Fix python setup in Dockerfiles.
    
    The dockerfile themselves were fixed up to account for updated pip
    install urls, deprecated deadsnakes PPA for Ubuntu 16.04, and curl
    misconfigurations for installing clang.
    
    Review: https://reviews.apache.org/r/75018/
---
 support/mesos-build/centos-7.dockerfile         |  2 +-
 support/mesos-build/ubuntu-16.04-arm.dockerfile | 24 ++++++++++++++----------
 support/mesos-build/ubuntu-16.04.dockerfile     | 23 ++++++++++++-----------
 3 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/support/mesos-build/centos-7.dockerfile 
b/support/mesos-build/centos-7.dockerfile
index 306102cf7..c75c5b61d 100644
--- a/support/mesos-build/centos-7.dockerfile
+++ b/support/mesos-build/centos-7.dockerfile
@@ -62,7 +62,7 @@ RUN yum install -y \
 RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
 
 # Install pip for Python 3.6.
-RUN curl https://bootstrap.pypa.io/get-pip.py | python3
+RUN curl https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3
 
 # Install virtualenv to /usr/bin/virtualenv with pip.
 RUN pip3 install --no-cache-dir virtualenv
diff --git a/support/mesos-build/ubuntu-16.04-arm.dockerfile 
b/support/mesos-build/ubuntu-16.04-arm.dockerfile
index 6a147394d..332009ff2 100644
--- a/support/mesos-build/ubuntu-16.04-arm.dockerfile
+++ b/support/mesos-build/ubuntu-16.04-arm.dockerfile
@@ -44,18 +44,22 @@ RUN apt-get update && \
     rm -rf /var/lib/apt/lists
 
 # Install Python 3.6.
-RUN add-apt-repository -y ppa:deadsnakes/ppa && \
-    apt-get update && \
-    apt-get install -qy \
-      python3.6 \
-      python3.6-dev \
-      python3.6-venv && \
-    add-apt-repository --remove -y ppa:deadsnakes/ppa && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists
+ENV PYTHON_VERSION=3.6.15
+
+# Download and install Python from source
+RUN curl 
https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz -o 
/tmp/Python-$PYTHON_VERSION.tgz && \
+    cd /tmp && \
+    tar xzf Python-$PYTHON_VERSION.tgz && \
+    cd Python-$PYTHON_VERSION && \
+    ./configure --enable-optimizations && \
+    make altinstall && \
+    rm -rf /tmp/Python-$PYTHON_VERSION.tgz /tmp/Python-$PYTHON_VERSION
+
+# Use update-alternatives to set python3.6 as python3.
+RUN update-alternatives --install /usr/bin/python3 python3 
/usr/local/bin/python3.6 1
 
 # Install newer Clang.
-RUN curl 
http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-aarch64-linux-gnu.tar.xz -o 
/tmp/clang.tar.xz && \
+RUN curl -L 
http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-aarch64-linux-gnu.tar.xz -o 
/tmp/clang.tar.xz && \
     tar -xf /tmp/clang.tar.xz && \
     rm /tmp/clang.tar.xz && \
     cp -R clang+llvm-8.0.0-aarch64-linux-gnu/* /usr/ && \
diff --git a/support/mesos-build/ubuntu-16.04.dockerfile 
b/support/mesos-build/ubuntu-16.04.dockerfile
index 0606170ef..70b269b79 100644
--- a/support/mesos-build/ubuntu-16.04.dockerfile
+++ b/support/mesos-build/ubuntu-16.04.dockerfile
@@ -50,21 +50,22 @@ RUN curl -sSL 
https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh \
     rm -f /tmp/install-cmake.sh
 
 # Install Python 3.6.
-RUN add-apt-repository -y ppa:deadsnakes/ppa && \
-    apt-get update && \
-    apt-get install -qy \
-      python3.6 \
-      python3.6-dev \
-      python3.6-venv && \
-    add-apt-repository --remove -y ppa:deadsnakes/ppa && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists
+ENV PYTHON_VERSION=3.6.15
+
+# Download and install Python from source
+RUN curl 
https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz -o 
/tmp/Python-$PYTHON_VERSION.tgz && \
+    cd /tmp && \
+    tar xzf Python-$PYTHON_VERSION.tgz && \
+    cd Python-$PYTHON_VERSION && \
+    ./configure --enable-optimizations && \
+    make altinstall && \
+    rm -rf /tmp/Python-$PYTHON_VERSION.tgz /tmp/Python-$PYTHON_VERSION
 
 # Use update-alternatives to set python3.6 as python3.
-RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
+RUN update-alternatives --install /usr/bin/python3 python3 
/usr/local/bin/python3.6 1
 
 # Install pip for Python 3.6.
-RUN curl https://bootstrap.pypa.io/get-pip.py | python3
+RUN curl https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3
 
 # Add an unprivileged user.
 RUN adduser --disabled-password --gecos '' mesos

Reply via email to