diff --git a/Dockerfile b/Dockerfile index e6752594..7ad6a87a 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.8.10 + +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 \ @@ -15,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 \ @@ -28,15 +41,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 setuptools wheel \ + && pip install \ Cython==0.29 RUN useradd --create-home --no-log-init --shell /bin/bash --uid $BUILDER_UID builder 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 +