Skip to content

Commit

Permalink
build: add Docker based PDF build environment
Browse files Browse the repository at this point in the history
Addresses #1043
  • Loading branch information
George Song committed Mar 11, 2021
1 parent b705694 commit 8e0070d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docker/docker-compose.build-pdf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'

services:
pdf-builder:
build:
context: ../
dockerfile: docker/images/Dockerfile.pdf-builder
image: edb/x-docs-pdf-builder
container_name: pdf-builder
hostname: pdf-builder
working_dir: /app
volumes:
- ../:/app
27 changes: 27 additions & 0 deletions docker/images/Dockerfile.pdf-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:focal

ARG PANDOC_VERSION=2.12
ARG PANDOC_DEB=pandoc-2.12-1-amd64.deb
ARG WKHTML_TO_PDF_VERSION=0.12.6-1
ARG WKHTML_TO_PDF_DEB=wkhtmltox_${WKHTML_TO_PDF_VERSION}.focal_amd64.deb

RUN apt-get update && apt-get install --no-install-recommends -y \
python3 \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install Pandoc
RUN wget --no-check-certificate -P /tmp https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${PANDOC_DEB} \
&& apt-get install --no-install-recommends -y /tmp/${PANDOC_DEB} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*

# Install wkhtmltopdf
RUN wget --no-check-certificate -P /tmp https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTML_TO_PDF_VERSION}/${WKHTML_TO_PDF_DEB} \
&& apt-get update \
&& apt-get install --no-install-recommends -y /tmp/${WKHTML_TO_PDF_DEB} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*

0 comments on commit 8e0070d

Please sign in to comment.