Created
April 29, 2022 07:52
-
-
Save lurodrig/25f5a4b2804027ff67b48cde4ae35568 to your computer and use it in GitHub Desktop.
Dockerfile for building pdfjs component for alfresco share
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.15.4 | |
RUN apk add -U curl \ | |
&& apk add -U unzip \ | |
&& rm -rf /var/cache/apk/* | |
# Download the latest release of pdfjs from github: | |
RUN curl --request GET -sL \ | |
--url 'https://github.com/mozilla/pdf.js/releases/download/v2.13.216/pdfjs-2.13.216-dist.zip' \ | |
--output '/tmp/pdfjs-2.13.216-dist.zip' | |
RUN unzip /tmp/pdfjs-2.13.216-dist.zip -d /tmp | |
RUN mkdir -p /tmp/pdfjs | |
RUN mv /tmp/build/* /tmp/pdfjs/ | |
RUN mv /tmp/web/cmaps /tmp/pdfjs/ | |
# sed kung-fu is needed to export the pdfjs module vars. Upstream pdf.js assumes is is deploed under pdfjs-dist/build/pdf | |
RUN sed -i 's/pdfjs-dist\/build\/pdf/\/share\/res\/components\/preview\/pdfjs\/pdf.js/g' /tmp/pdfjs/pdf.js | |
RUN sed -i 's/pdfjs-dist\/build\/pdf.worker/\/share\/res\/components\/preview\/pdfjs\/pdf.worker.js/g' /tmp/pdfjs/pdf.worker.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment