From 429d8315269b0f818b20c6de155474e0916eb463 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 8 Aug 2023 12:16:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Install=20pyenv=20in=20CUDA=20im?= =?UTF-8?q?age,=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core-cuda12.1 | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/Dockerfile-core-cuda12.1 b/Dockerfile-core-cuda12.1 index 190e8dc..7429b8c 100644 --- a/Dockerfile-core-cuda12.1 +++ b/Dockerfile-core-cuda12.1 @@ -9,10 +9,10 @@ ENV PIP_DEFAULT_TIMEOUT=120 RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ apt-get update && \ apt-get install -y \ - curl xz-utils \ - build-essential python3-dev \ -# For get-pip.py: - python3-distutils \ + build-essential \ + curl \ + git \ + xz-utils \ # For add-apt-repository: software-properties-common \ # XML utils @@ -20,6 +20,17 @@ RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ xmlstarlet \ # OCR-D uses ImageMagick for pixel density estimation imagemagick \ +# pyenv builds +# TODO: builder container? + libz-dev \ + libssl-dev \ + libbz2-dev \ + liblzma-dev \ + libncurses-dev \ + libffi-dev \ + libreadline-dev \ + libsqlite3-dev \ + libmagic-dev \ && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -29,14 +40,19 @@ RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_logging.py -# Install pip (and setuptools) -# We use get-pip.py here to avoid -# a. having to upgrade from Ubuntu's pip -# b. the dreaded "old script wrapper" error message -RUN curl -sSL https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py && \ - python3 get-pip.py && \ - rm -f get-pip.py - +# Install pyenv +# TODO: do not run as root +# TODO: does just saying "3.7" work as intended? +ENV HOME=/root +ENV PYENV_ROOT=/usr/local/share/pyenv +ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH +RUN \ + git clone --depth=1 https://github.com/yyuu/pyenv.git $PYENV_ROOT && \ + pyenv install 3.7 && \ + pyenv global 3.7 && \ + pyenv rehash && \ + pip install -U pip wheel && \ + pip install setuptools # Install pip installable-stuff RUN ${PIP_INSTALL} \