From 419a38e5869a3c7b4c98d44ad7f902214da759ae Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Thu, 26 Oct 2023 18:21:02 -0700 Subject: [PATCH] chore(release) use Python 3.8+ in older distributions Fixing V8 build issues, see NVIDIA/DeepLearningExamples#1016 Fixes #430 --- assets/release/Dockerfiles/Dockerfile.amd64.centos7 | 13 ++++++++----- assets/release/Dockerfiles/Dockerfile.amd64.centos8 | 2 +- .../Dockerfiles/Dockerfile.amd64.ubuntu-18.04 | 11 +++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/assets/release/Dockerfiles/Dockerfile.amd64.centos7 b/assets/release/Dockerfiles/Dockerfile.amd64.centos7 index 62ea24da4..a98b2891a 100644 --- a/assets/release/Dockerfiles/Dockerfile.amd64.centos7 +++ b/assets/release/Dockerfiles/Dockerfile.amd64.centos7 @@ -1,8 +1,11 @@ -FROM amd64/centos:7 +# Use Python 3.8+ (required by V8's GN build system) +# See https://hub.docker.com/r/centos/python-38-centos7 +FROM centos/python-38-centos7 COPY . /ngx_wasm_module +USER root -RUN yum install -y epel-release && \ - yum update -y && \ +RUN yum update -y && \ + yum install -y epel-release && \ yum install -y centos-release-scl && \ yum install -y \ devtoolset-8 \ @@ -13,16 +16,16 @@ RUN yum install -y epel-release && \ cmake3 \ make \ gcc \ - python3 \ git \ glib2-devel \ perl \ perl-IPC-Cmd \ perl-Test-Simple +RUN ln -nfs $(which cmake3) /usr/bin/cmake + ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo ENV PATH $CARGO_HOME/bin:$PATH -RUN ln -nfs $(which cmake3) /usr/bin/cmake RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \ chmod -R a=rwX $CARGO_HOME $RUSTUP_HOME diff --git a/assets/release/Dockerfiles/Dockerfile.amd64.centos8 b/assets/release/Dockerfiles/Dockerfile.amd64.centos8 index 7ecb451e8..9f374b4dc 100644 --- a/assets/release/Dockerfiles/Dockerfile.amd64.centos8 +++ b/assets/release/Dockerfiles/Dockerfile.amd64.centos8 @@ -13,7 +13,7 @@ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \ libstdc++-devel \ libatomic \ perl \ - python3 \ + python39 \ git \ glib2-devel diff --git a/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 b/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 index bfe8bb2f7..cc51dc32c 100644 --- a/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 +++ b/assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04 @@ -2,13 +2,20 @@ FROM amd64/ubuntu:18.04 COPY . /ngx_wasm_module ARG DEBIAN_FRONTEND=noninteractive + +# Install Python 3.8+ (required by V8's GN build system) +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + add-apt-repository -y ppa:deadsnakes/ppa && \ + apt-get update && \ + apt-get install -y python3.8 && \ + ln -nfs $(which python3.8) /usr/bin/python3 + RUN apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates \ build-essential \ ninja-build \ - python3 \ - cmake \ gcc-8 \ libstdc++-8-dev \ git \