-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
27 lines (24 loc) · 812 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM amazonlinux:2
RUN yum install -y \
rpmdevtools \
wget \
yum-utils
WORKDIR /tmp
# Download wkhtmltopdf and its dependencies. Then extract all rpm files.
ENV WKHTMLTOPDF_BIN="wkhtmltopdf.rpm"
RUN wget -O $WKHTMLTOPDF_BIN https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.$(arch).rpm \
&& yum install --downloadonly --downloaddir=/tmp $WKHTMLTOPDF_BIN \
&& yumdownloader --archlist=$(arch) \
bzip2-libs \
expat \
libuuid \
&& rpmdev-extract *rpm
WORKDIR /layer
# Copy wkhtmltopdf binary and dependency libraries for packaging
RUN mkdir -p {bin,lib} \
&& cp /tmp/wkhtml*/usr/local/bin/* bin \
&& cp /tmp/*/usr/lib64/* lib || :
# Zip files
ENV LAYER_ZIP="layer.zip"
RUN zip -r $LAYER_ZIP bin lib \
&& mv $LAYER_ZIP /