mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Fix Armv7 Docker build
This commit is contained in:
		
							
								
								
									
										12
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -316,14 +316,6 @@ jobs:
 | 
				
			|||||||
      -
 | 
					      -
 | 
				
			||||||
        name: Set up QEMU
 | 
					        name: Set up QEMU
 | 
				
			||||||
        uses: docker/setup-qemu-action@v1
 | 
					        uses: docker/setup-qemu-action@v1
 | 
				
			||||||
      -
 | 
					 | 
				
			||||||
        name: Cache Docker layers
 | 
					 | 
				
			||||||
        uses: actions/cache@v2
 | 
					 | 
				
			||||||
        with:
 | 
					 | 
				
			||||||
          path: /tmp/.buildx-cache
 | 
					 | 
				
			||||||
          key: ${{ runner.os }}-buildx-${{ github.sha }}
 | 
					 | 
				
			||||||
          restore-keys: |
 | 
					 | 
				
			||||||
            ${{ runner.os }}-buildx-
 | 
					 | 
				
			||||||
      -
 | 
					      -
 | 
				
			||||||
        name: Login to Github Container Registry
 | 
					        name: Login to Github Container Registry
 | 
				
			||||||
        uses: docker/login-action@v1
 | 
					        uses: docker/login-action@v1
 | 
				
			||||||
@@ -340,8 +332,8 @@ jobs:
 | 
				
			|||||||
          platforms: linux/amd64,linux/arm/v7,linux/arm64
 | 
					          platforms: linux/amd64,linux/arm/v7,linux/arm64
 | 
				
			||||||
          push: true
 | 
					          push: true
 | 
				
			||||||
          tags: ${{ steps.prepare.outputs.tags }}
 | 
					          tags: ${{ steps.prepare.outputs.tags }}
 | 
				
			||||||
          cache-from: type=local,src=/tmp/.buildx-cache
 | 
					          cache-from: type=gha
 | 
				
			||||||
          cache-to: type=local,dest=/tmp/.buildx-cache
 | 
					          cache-to: type=gha,mode=max
 | 
				
			||||||
      -
 | 
					      -
 | 
				
			||||||
        name: Inspect image
 | 
					        name: Inspect image
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										23
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -8,6 +8,7 @@ RUN git clone https://github.com/agl/jbig2enc .
 | 
				
			|||||||
RUN ./autogen.sh
 | 
					RUN ./autogen.sh
 | 
				
			||||||
RUN ./configure && make
 | 
					RUN ./configure && make
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM python:3.9-slim-bullseye
 | 
					FROM python:3.9-slim-bullseye
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Binary dependencies
 | 
					# Binary dependencies
 | 
				
			||||||
@@ -39,7 +40,6 @@ RUN apt-get update \
 | 
				
			|||||||
		media-types \
 | 
							media-types \
 | 
				
			||||||
		# OCRmyPDF dependencies
 | 
							# OCRmyPDF dependencies
 | 
				
			||||||
		liblept5 \
 | 
							liblept5 \
 | 
				
			||||||
		qpdf \
 | 
					 | 
				
			||||||
		tesseract-ocr \
 | 
							tesseract-ocr \
 | 
				
			||||||
		tesseract-ocr-eng \
 | 
							tesseract-ocr-eng \
 | 
				
			||||||
		tesseract-ocr-deu \
 | 
							tesseract-ocr-deu \
 | 
				
			||||||
@@ -62,11 +62,26 @@ RUN apt-get update \
 | 
				
			|||||||
  && apt-get -y --no-install-recommends install \
 | 
					  && apt-get -y --no-install-recommends install \
 | 
				
			||||||
		build-essential \
 | 
							build-essential \
 | 
				
			||||||
		libpq-dev \
 | 
							libpq-dev \
 | 
				
			||||||
		libqpdf-dev \
 | 
							git \
 | 
				
			||||||
	&& python3 -m pip install --upgrade pip setuptools wheel \
 | 
							zlib1g-dev \
 | 
				
			||||||
 | 
							libjpeg62-turbo-dev \
 | 
				
			||||||
 | 
						&& if [ "$(uname -m)" = "armv7l" ]; \
 | 
				
			||||||
 | 
						  then echo "Building qpdf" \
 | 
				
			||||||
 | 
						  && mkdir -p /usr/src/qpdf \
 | 
				
			||||||
 | 
						  && cd /usr/src/qpdf \
 | 
				
			||||||
 | 
						  && git clone https://github.com/qpdf/qpdf.git . \
 | 
				
			||||||
 | 
						  && git checkout --quiet release-qpdf-10.6.2 \
 | 
				
			||||||
 | 
						  && ./configure \
 | 
				
			||||||
 | 
						  && make \
 | 
				
			||||||
 | 
						  && make install \
 | 
				
			||||||
 | 
						  && cd /usr/src/paperless/src/ \
 | 
				
			||||||
 | 
						  && rm -rf /usr/src/qpdf; \
 | 
				
			||||||
 | 
						else \
 | 
				
			||||||
 | 
						  echo "Skipping qpdf build because pikepdf binary wheels are available."; \
 | 
				
			||||||
 | 
						fi \
 | 
				
			||||||
	&& python3 -m pip install --default-timeout=1000 --upgrade --no-cache-dir supervisor \
 | 
						&& python3 -m pip install --default-timeout=1000 --upgrade --no-cache-dir supervisor \
 | 
				
			||||||
  && python3 -m pip install --default-timeout=1000 --no-cache-dir -r ../requirements.txt \
 | 
					  && python3 -m pip install --default-timeout=1000 --no-cache-dir -r ../requirements.txt \
 | 
				
			||||||
	&& apt-get -y purge build-essential libqpdf-dev \
 | 
						&& apt-get -y purge build-essential git zlib1g-dev libjpeg62-turbo-dev \
 | 
				
			||||||
	&& apt-get -y autoremove --purge \
 | 
						&& apt-get -y autoremove --purge \
 | 
				
			||||||
	&& rm -rf /var/lib/apt/lists/*
 | 
						&& rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user