From 559d5e347d53ce0811b93cd7a1719e5bfbb6dc83 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Tue, 19 Apr 2022 16:39:44 +0200 Subject: [PATCH] build: update python --- .editorconfig | 10 ++++++++++ stretch-arm64/Dockerfile | 36 ++++++++++++++++++++++++++++++++++-- stretch-armhf/Dockerfile | 36 ++++++++++++++++++++++++++++++++++-- 3 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aaaa7a4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/stretch-arm64/Dockerfile b/stretch-arm64/Dockerfile index 0a9739a..1b20e7c 100644 --- a/stretch-arm64/Dockerfile +++ b/stretch-arm64/Dockerfile @@ -7,18 +7,50 @@ RUN apt-get update && apt-get install -y -t stretch-backports git git-man RUN dpkg --add-architecture arm64 RUN apt-get update && apt-get install -y --no-install-recommends \ crossbuild-essential-arm64 \ - python \ git \ pkg-config \ fakeroot \ rpm \ + sudo \ + apt-transport-https \ ca-certificates \ libx11-dev:arm64 \ libx11-xcb-dev:arm64 \ libxkbfile-dev:arm64 \ libsecret-1-dev:arm64 \ curl \ - jq + jq \ + gnupg \ + unzip \ + # Dependencies for building python from source + build-essential \ + libreadline-gplv2-dev \ + libncursesw5-dev \ + libssl-dev \ + libsqlite3-dev \ + tk-dev \ + libgbm-dev \ + libc6-dev \ + libbz2-dev \ + libffi-dev \ + zlib1g-dev + +# Compile python3.9 from source +RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz +RUN tar -xf Python-3.9.4.tar.xz +RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall +RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1 +RUN python --version + +# Remove expired CA cert for openSSL 1.0.2 +# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/ +RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt +RUN update-ca-certificates --fresh + +# Yarn +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list +RUN apt-get update && apt-get install -y yarn ENV AS=/usr/bin/aarch64-linux-gnu-as \ AR=/usr/bin/aarch64-linux-gnu-ar \ diff --git a/stretch-armhf/Dockerfile b/stretch-armhf/Dockerfile index a31db41..06c229a 100644 --- a/stretch-armhf/Dockerfile +++ b/stretch-armhf/Dockerfile @@ -7,18 +7,50 @@ RUN apt-get update && apt-get install -y -t stretch-backports git git-man RUN dpkg --add-architecture armhf RUN apt-get update && apt-get install -y --no-install-recommends \ crossbuild-essential-armhf \ - python \ git \ pkg-config \ fakeroot \ rpm \ + sudo \ + apt-transport-https \ ca-certificates \ libx11-dev:armhf \ libx11-xcb-dev:armhf \ libxkbfile-dev:armhf \ libsecret-1-dev:armhf \ curl \ - jq + jq \ + gnupg \ + unzip \ + # Dependencies for building python from source + build-essential \ + libreadline-gplv2-dev \ + libncursesw5-dev \ + libssl-dev \ + libsqlite3-dev \ + tk-dev \ + libgbm-dev \ + libc6-dev \ + libbz2-dev \ + libffi-dev \ + zlib1g-dev + +# Compile python3.9 from source +RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz +RUN tar -xf Python-3.9.4.tar.xz +RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall +RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1 +RUN python --version + +# Remove expired CA cert for openSSL 1.0.2 +# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/ +RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt +RUN update-ca-certificates --fresh + +# Yarn +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list +RUN apt-get update && apt-get install -y yarn ENV AS=/usr/bin/arm-linux-gnueabihf-as \ AR=/usr/bin/arm-linux-gnueabihf-ar \