diff --git a/.dockerignore b/.dockerignore index b05c3a5..fe93295 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ test/ dist/ build/ +repo/assets diff --git a/Dockerfile b/Dockerfile index b025ba9..c174d37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ ARG DOCKER_BASE_IMAGE FROM $DOCKER_BASE_IMAGE -# install ocrd-tesserocr (until here commands for installing tesseract-ocr) ARG VCS_REF ARG BUILD_DATE LABEL \ @@ -46,6 +45,8 @@ COPY . . COPY ocrd-tool.json . # prepackage ocrd-tool.json as ocrd-all-tool.json RUN ocrd ocrd-tool ocrd-tool.json dump-tools > $(dirname $(ocrd bashlib filename))/ocrd-all-tool.json +# prepackage ocrd-all-module-dir.json +RUN ocrd ocrd-tool ocrd-tool.json dump-module-dirs > $(dirname $(ocrd bashlib filename))/ocrd-all-module-dir.json # install everything and reduce image size RUN make deps-ubuntu \ && make -j4 install GIT_SUBMODULE=: \ diff --git a/Makefile b/Makefile index 4dd06e9..9135c7b 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ export SHELL = /bin/bash PYTHON = python3 +DOCKER = docker PIP = pip3 GIT_SUBMODULE = git submodule LOG_LEVEL = INFO @@ -28,7 +29,7 @@ PYTEST_ARGS = # Docker container tag DOCKER_TAG = 'ocrd/tesserocr' -DOCKER_BASE_IMAGE = docker.io/ocrd/core:v3.3.0 +DOCKER_BASE_IMAGE = docker.io/ocrd/core:latest help: @echo "" @@ -102,7 +103,7 @@ deps-test: # Build docker image docker: repo/tesseract repo/tesserocr - docker build \ + $(DOCKER) build \ --build-arg DOCKER_BASE_IMAGE=$(DOCKER_BASE_IMAGE) \ --build-arg VCS_REF=$$(git rev-parse --short HEAD) \ --build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ @@ -122,7 +123,7 @@ $(TESSERACT_PREFIX)/bin/tesseract: build/tesseract/Makefile $(TESSERACT_PREFIX)/bin/lstmtraining: build/tesseract/Makefile $(MAKE) -C build/tesseract training-install -TESSERACT_CONFIG ?= --disable-openmp --disable-shared CXXFLAGS="-g -O2 -fPIC -fno-math-errno -Wall -Wextra -Wpedantic" +TESSERACT_CONFIG ?= --disable-openmp --disable-shared CXXFLAGS="-g -O2 -fPIC -fno-math-errno -Wall -Wextra -Wpedantic -UNDEBUG" build/tesseract/Makefile: repo/tesseract/Makefile.in mkdir -p $(@D) cd $(@D) && $(CURDIR)/repo/tesseract/configure \