| 
									
										
										
										
											2020-08-14 14:37:20 +02:00
										 |  |  | FROM ubuntu:18.04 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-19 18:25:10 +01:00
										 |  |  | ARG PIP_INSTALL="pip install --no-cache-dir --use-feature=2020-resolver" | 
					
						
							| 
									
										
										
										
											2020-12-03 18:01:21 +01:00
										 |  |  | ARG OCRD_VERSION_MINIMUM="2.21.0" | 
					
						
							| 
									
										
										
										
											2020-08-14 14:37:20 +02:00
										 |  |  | 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 \ | 
					
						
							|  |  |  |       curl xz-utils \ | 
					
						
							| 
									
										
										
										
											2020-08-14 17:17:25 +02:00
										 |  |  |       build-essential python3-dev \ | 
					
						
							|  |  |  | # For get-pip.py: | 
					
						
							|  |  |  |       python3-distutils \ | 
					
						
							| 
									
										
										
										
											2020-08-14 14:37:20 +02:00
										 |  |  | # For add-apt-repository: | 
					
						
							|  |  |  |       software-properties-common \ | 
					
						
							|  |  |  | # XML utils | 
					
						
							|  |  |  |       libxml2-utils \ | 
					
						
							|  |  |  |       xmlstarlet \ | 
					
						
							|  |  |  |     && \ | 
					
						
							|  |  |  |     apt-get clean && \ | 
					
						
							|  |  |  |     rm -rf /var/lib/apt/lists/* | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Set up OCR-D logging | 
					
						
							| 
									
										
										
										
											2020-08-24 19:35:08 +02:00
										 |  |  | RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_logging.py | 
					
						
							| 
									
										
										
										
											2020-08-14 14:37:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-14 17:17:25 +02:00
										 |  |  | # 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/get-pip.py -o get-pip.py && \ | 
					
						
							|  |  |  |     python3 get-pip.py && \ | 
					
						
							|  |  |  |     rm -f get-pip.py | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Install pip installable-stuff | 
					
						
							| 
									
										
										
										
											2020-09-25 16:11:11 +02:00
										 |  |  | RUN ${PIP_INSTALL} \ | 
					
						
							| 
									
										
										
										
											2020-10-23 17:33:20 +02:00
										 |  |  |         "ocrd >= ${OCRD_VERSION_MINIMUM}" | 
					
						
							| 
									
										
										
										
											2020-08-14 14:37:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Check pip dependencies | 
					
						
							| 
									
										
										
										
											2020-11-19 18:25:10 +01:00
										 |  |  | RUN pip check | 
					
						
							| 
									
										
										
										
											2020-08-14 14:37:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WORKDIR /data | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Default command | 
					
						
							|  |  |  | CMD ['ocrd'] |