diff options
| author | luccioman <luccioman@users.noreply.github.com> | 2018-12-17 10:34:51 +0100 |
|---|---|---|
| committer | luccioman <luccioman@users.noreply.github.com> | 2018-12-17 10:34:51 +0100 |
| commit | 55b059bfb5b26d9b5234da118cdfee7216b93d74 (patch) | |
| tree | 63c36a66d6f956c94af8a90b9034e6bab682ad9b /docker | |
| parent | 0cf96031acb1d12f999918d243d69e4d2c5d02d1 (diff) | |
Fixed wkhtmltopdf integration in Alpine flavor Docker image
Building now wkhtmltopdf (used for snapshots generation) from sources,
as its package is only available on the Alpine edge branch and is not
compatible with the current Alpine (3.8) stable base image used for
YaCy.
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/Dockerfile.alpine | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index 97a590f42..6ce53849e 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -7,15 +7,45 @@ FROM openjdk:8-alpine RUN java -version # Install needed packages not in base image -# (curl for sh scripts in /bin, and wkhtmltopdf,imagemagick,xvfb and ghostscript to enable PDF and image snapshot generation) -RUN apk add --no-cache curl imagemagick xvfb ghostscript && \ - apk add wkhtmltopdf --no-cache --repository https://uk.alpinelinux.org/alpine/edge/community/ +# (curl for sh scripts in /bin, and imagemagick,xvfb and ghostscript to enable PDF and image snapshot generation) +RUN apk add --no-cache curl imagemagick xvfb ghostscript + +# --- Begin of wkhtmltopdf install : compile from sources because the wkhtmltopdf Alpine package is currently only on the Alpine edge branch # set current working dir WORKDIR /tmp +# set wkhtmltopdf version once in a environment variable +ENV WKHTMLTOPDF_VERSION 0.12.5 + +# Download and extract wkhtmltopdf sources +RUN curl -fSL https://github.com/wkhtmltopdf/wkhtmltopdf/archive/${WKHTMLTOPDF_VERSION}.tar.gz -o wkhtmltopdf-${WKHTMLTOPDF_VERSION}-src.tar.gz && \ + tar xzf wkhtmltopdf-${WKHTMLTOPDF_VERSION}-src.tar.gz + +# set current working dir +WORKDIR wkhtmltopdf-${WKHTMLTOPDF_VERSION} + +# All in one step to reduce image size growth : +# - add packages necessary to build wkhtmltopdf from sources and then to run it +# - build wkhtmltopdf +# - create a symbolic link to the wkhtmltopdf executable at a path where YaCy is expecting it +# - remove the sources archive +# - remove the build packages +RUN apk update && \ + apk add --no-cache g++ make qt5-qtbase-dev qt5-qtwebkit-dev qt5-qtsvg-dev qt5-qtxmlpatterns-dev libgcc libstdc++ musl qt5-qtbase qt5-qtbase-x11 qt5-qtsvg qt5-qtwebkit && \ + qmake-qt5 -makefile && \ + make && \ + make install && \ + rm -f /tmp/wkhtmltopdf-${WKHTMLTOPDF_VERSION}-src.tar.gz && \ + apk del g++ make qt5-qtbase-dev qt5-qtwebkit-dev qt5-qtsvg-dev qt5-qtxmlpatterns-dev + +# --- End of wkhtmltopdf install + # --- Begin of apache ant install : from binary distribution because ant is not in alpine packages +# set current working dir +WORKDIR /tmp + # set ant version once in a environment variable ENV ANT_VERSION 1.10.5 |
