From c56f692ff5dc5a542729d4ddc385b782cad0503a Mon Sep 17 00:00:00 2001 From: Malte Date: Tue, 27 Oct 2020 06:00:55 +0100 Subject: [PATCH] (DOCKER) allows to use jbarlow83's official docker image of OCRmyPDF, i.e. use a newer version - if `/var/run/docker.sock` is found in the docker-container, this feature is activated - if not, nothing changes - usage: mount bind `docker.sock` from host by using `-v` or `volumes:` --- docker/joex-entrypoint.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/joex-entrypoint.sh b/docker/joex-entrypoint.sh index 3ed3df29..a2d44b23 100755 --- a/docker/joex-entrypoint.sh +++ b/docker/joex-entrypoint.sh @@ -3,4 +3,15 @@ echo "Starting unoconv listener" unoconv -l & +# replace own ocrmypdf with official dockerfile, i.e. newer version +if [ -S "/var/run/docker.sock" ]; then + echo "Found 'docker.sock': Installing Docker and redirecting 'ocrmypdf' command to official dockerfile by jbarlow83" + apk --no-cache add docker + docker pull jbarlow83/ocrmypdf + function ocrmypdf () { + docker run jbarlow83/ocrmypdf $@ + } + echo "Using OCRmyPDF v$(ocrmypdf --version)" && echo +fi + /opt/docspell-joex/bin/docspell-joex "$@"