From 3b3144480b5a5f850d4f5be32bc72f46fcc672fd Mon Sep 17 00:00:00 2001 From: Stefan Hattrell <29941279+digorgonzola@users.noreply.github.com> Date: Wed, 2 Feb 2022 14:05:09 +1100 Subject: [PATCH 1/4] use pyenv in docker env --- Dockerfile | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6752594..2a773726 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,24 @@ -FROM ubuntu:16.04 +FROM ubuntu:latest ARG BUILDER_UID=9999 +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=Australia/Hobart ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 ENV PATH /home/builder/.local/bin:$PATH -ENV DEBIAN_FRONTEND noninteractive -ENV DOCKER_TESTING true +ENV PYTHON_VERSION 3.5.2 + +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + rm -rf /var/lib/apt/lists/* + +RUN add-apt-repository ppa:rael-gc/rvm && apt-get update + +RUN if [ X"$PYTHON_VERSION" = X"3.5.2" ]; \ + then apt-get install -y libssl1.0-dev; \ + else apt-get install -y libssl-dev; \ + fi RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ @@ -28,15 +40,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ unzip \ wget \ zip \ + # Pyenv pre-requisites + make zlib1g-dev libbz2-dev libreadline-dev \ + libsqlite3-dev wget curl llvm libncurses5-dev \ + libncursesw5-dev xz-utils tk-dev libffi-dev \ + liblzma-dev python-openssl \ && rm -rf /var/lib/apt/lists/* -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10 +# Set-up necessary Env vars for PyEnv +ENV PYENV_ROOT $HOME/.pyenv +ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH -RUN wget -q https://bootstrap.pypa.io/pip/3.5/get-pip.py \ - && python get-pip.py pip==18.1 setuptools==49.6.0 wheel==0.35.1 \ - && rm -rf get-pip.py +# Install pyenv +RUN set -ex \ + && curl https://pyenv.run | bash \ + && pyenv install $PYTHON_VERSION \ + && pyenv global $PYTHON_VERSION \ + && pyenv rehash \ + && chmod -R a+w $PYENV_ROOT/shims -RUN pip install \ +RUN pip install --upgrade pip==20.3.4 setuptools==50.3.2 \ + && pip install \ Cython==0.29 RUN useradd --create-home --no-log-init --shell /bin/bash --uid $BUILDER_UID builder From 0d489d8ec9725fbce777a3fc54203e17b99e72bf Mon Sep 17 00:00:00 2001 From: Stefan Hattrell <29941279+digorgonzola@users.noreply.github.com> Date: Thu, 3 Feb 2022 09:32:06 +1100 Subject: [PATCH 2/4] include libatlas-base-dev modified: Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 2a773726..24ad6575 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ libblas-dev \ libfreetype6-dev \ + libatlas-base-dev \ liblapack-dev \ libnetcdf-dev \ libpng-dev \ From 48caadc784ec9df55a0e45d7ac9ed5ca85b02d1e Mon Sep 17 00:00:00 2001 From: Stefan Hattrell <29941279+digorgonzola@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:34:10 +1100 Subject: [PATCH 3/4] update requirements to allow upgrade of wand for python > 3.5 --- requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d179cd89..e17a8c1a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,8 +18,10 @@ scipy==1.4.1; python_version > '3.5' six tendo==0.2.15 click -wand==0.4.4 +wand==0.6.7; python_version > '3.5' +wand==0.4.4; python_version < '3.6' functools32; python_version < '3.3' xlrd beautifulsoup4 compliance-checker==4.1.1 + From 7d0f852e2967ae68dde474037f4a4a6af1942183 Mon Sep 17 00:00:00 2001 From: Stefan Hattrell <29941279+digorgonzola@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:35:04 +1100 Subject: [PATCH 4/4] use python 3.8.10 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24ad6575..7ad6a87a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ENV TZ=Australia/Hobart ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 ENV PATH /home/builder/.local/bin:$PATH -ENV PYTHON_VERSION 3.5.2 +ENV PYTHON_VERSION 3.8.10 RUN apt-get update && \ apt-get install -y software-properties-common && \ @@ -60,7 +60,7 @@ RUN set -ex \ && pyenv rehash \ && chmod -R a+w $PYENV_ROOT/shims -RUN pip install --upgrade pip==20.3.4 setuptools==50.3.2 \ +RUN pip install --upgrade pip setuptools wheel \ && pip install \ Cython==0.29