ocrd-galley/Dockerfile-core

70 lines
1.5 KiB
Text
Raw Normal View History

FROM ubuntu:22.04
ARG PIP_INSTALL="pip install --no-cache-dir"
ARG OCRD_VERSION_MINIMUM="2.23.3"
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
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 \
2023-02-08 12:38:20 +01:00
build-essential \
curl \
git \
xz-utils \
# For add-apt-repository:
software-properties-common \
# XML utils
libxml2-utils \
xmlstarlet \
# OCR-D uses ImageMagick for pixel density estimation
imagemagick \
2023-02-08 14:18:30 +01:00
# 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/*
# Set up OCR-D logging
RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_logging.py
2023-02-08 12:35:57 +01:00
# Install pyenv
# TODO: do not run as root
# TODO: does just saying "3.7" work as intended?
ENV HOME=/root
2023-02-08 14:18:30 +01:00
ENV PYENV_ROOT=/usr/local/share/pyenv
2023-02-08 12:35:57 +01:00
ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN \
2023-02-08 14:18:30 +01:00
git clone --depth=1 https://github.com/yyuu/pyenv.git $PYENV_ROOT && \
2023-02-08 12:35:57 +01:00
pyenv install 3.7 && \
pyenv global 3.7 && \
2023-02-08 14:18:30 +01:00
pyenv rehash && \
pip install -U pip && \
pip install setuptools
2020-08-14 17:17:25 +02:00
# Install pip installable-stuff
RUN ${PIP_INSTALL} \
"ocrd >= ${OCRD_VERSION_MINIMUM}"
# Check pip dependencies
2020-11-19 18:25:10 +01:00
RUN pip check
WORKDIR /data
# Default command
CMD ['ocrd']