| 
									
										
										
										
											2024-09-16 18:21:14 +02:00
										 |  |  | ARG DOCKER_BASE_IMAGE | 
					
						
							|  |  |  | FROM $DOCKER_BASE_IMAGE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ARG VCS_REF | 
					
						
							|  |  |  | ARG BUILD_DATE | 
					
						
							|  |  |  | LABEL \ | 
					
						
							| 
									
										
										
										
											2025-03-31 14:14:08 +02:00
										 |  |  |     maintainer="https://ocr-d.de/en/contact" \ | 
					
						
							| 
									
										
										
										
											2024-09-16 18:21:14 +02:00
										 |  |  |     org.label-schema.vcs-ref=$VCS_REF \ | 
					
						
							|  |  |  |     org.label-schema.vcs-url="https://github.com/qurator-spk/eynollah" \ | 
					
						
							| 
									
										
										
										
											2025-03-31 14:14:08 +02:00
										 |  |  |     org.label-schema.build-date=$BUILD_DATE \ | 
					
						
							|  |  |  |     org.opencontainers.image.vendor="DFG-Funded Initiative for Optical Character Recognition Development" \ | 
					
						
							|  |  |  |     org.opencontainers.image.title="Eynollah" \ | 
					
						
							|  |  |  |     org.opencontainers.image.description="" \ | 
					
						
							|  |  |  |     org.opencontainers.image.source="https://github.com/qurator-spk/eynollah" \ | 
					
						
							|  |  |  |     org.opencontainers.image.documentation="https://github.com/qurator-spk/eynollah/blob/${VCS_REF}/README.md" \ | 
					
						
							|  |  |  |     org.opencontainers.image.revision=$VCS_REF \ | 
					
						
							|  |  |  |     org.opencontainers.image.created=$BUILD_DATE \ | 
					
						
							|  |  |  |     org.opencontainers.image.base.name=ocrd/core-cuda-tf2 | 
					
						
							| 
									
										
										
										
											2024-09-16 18:21:14 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ENV DEBIAN_FRONTEND=noninteractive | 
					
						
							| 
									
										
										
										
											2025-03-31 14:14:08 +02:00
										 |  |  | # set proper locales | 
					
						
							| 
									
										
										
										
											2024-09-16 18:21:14 +02:00
										 |  |  | ENV PYTHONIOENCODING=utf8 | 
					
						
							| 
									
										
										
										
											2025-03-31 14:14:08 +02:00
										 |  |  | ENV LANG=C.UTF-8 | 
					
						
							|  |  |  | ENV LC_ALL=C.UTF-8 | 
					
						
							| 
									
										
										
										
											2024-09-16 18:21:14 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-31 14:14:08 +02:00
										 |  |  | # avoid HOME/.local/share (hard to predict USER here) | 
					
						
							|  |  |  | # so let XDG_DATA_HOME coincide with fixed system location | 
					
						
							|  |  |  | # (can still be overridden by derived stages) | 
					
						
							|  |  |  | ENV XDG_DATA_HOME /usr/local/share | 
					
						
							|  |  |  | # avoid the need for an extra volume for persistent resource user db | 
					
						
							|  |  |  | # (i.e. XDG_CONFIG_HOME/ocrd/resources.yml) | 
					
						
							|  |  |  | ENV XDG_CONFIG_HOME /usr/local/share/ocrd-resources | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORKDIR /build/eynollah | 
					
						
							|  |  |  | 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 | 
					
						
							| 
									
										
										
										
											2025-05-02 00:13:11 +02:00
										 |  |  | # 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 | 
					
						
							| 
									
										
										
										
											2025-03-31 14:14:08 +02:00
										 |  |  | # install everything and reduce image size | 
					
						
							| 
									
										
										
										
											2025-03-31 15:58:57 +02:00
										 |  |  | RUN make install EXTRAS=OCR && rm -rf /build/eynollah | 
					
						
							| 
									
										
										
										
											2025-09-30 22:10:45 +02:00
										 |  |  | # fixup for broken cuDNN installation (Torch pulls in 8.5.0, which is incompatible with Tensorflow) | 
					
						
							|  |  |  | RUN pip install nvidia-cudnn-cu11==8.6.0.163 | 
					
						
							| 
									
										
										
										
											2025-03-31 16:56:47 +02:00
										 |  |  | # smoke test | 
					
						
							|  |  |  | RUN eynollah --help | 
					
						
							| 
									
										
										
										
											2024-09-16 18:21:14 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | WORKDIR /data | 
					
						
							|  |  |  | VOLUME /data |