🚧 Install pyenv in CUDA image, too

master
Gerber, Mike 9 months ago
parent c8de7b6769
commit 429d831526

@ -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} \

Loading…
Cancel
Save