Skip to content

Commit

Permalink
Merge pull request #44 from IvanKuchin/development
Browse files Browse the repository at this point in the history
Infrastructure: dynamic insertion of wkhtmltox into .deb
  • Loading branch information
IvanKuchin authored Jun 3, 2022
2 parents 2b3538a + c4e3b65 commit 4597be4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
24 changes: 14 additions & 10 deletions supplemental/docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ RUN apt update \
wget \
&& apt-get clean

#############################
# libwkhtmltox installation #
#############################
RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb
RUN apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox_0.12.5-1.trusty_amd64.deb

#############################
# libwebsocket installation #
#############################
Expand All @@ -124,6 +118,14 @@ RUN if test -f "./libxl-3.8.4.0/lib64/libxl.so"; then \
&& ldconfig; \
fi

#############################
# libwkhtmltox installation #
#############################
RUN if test -d "./wkhtmltox"; then \
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb \
&& apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox*.deb; \
fi

##################
# save commit id #
##################
Expand Down Expand Up @@ -169,9 +171,7 @@ RUN cd build \
-DLOCAL_INSTALL_DIR=${LOCAL_INSTALL_DIR} \
-DBUILD_RELEASE_NUMBER=${BUILD_RELEASE_NUMBER} \
.. \
&& make -j2 package \
&& make install \
&& make clean
&& make -j2 package

# EXPOSE 80

Expand Down Expand Up @@ -218,6 +218,11 @@ COPY --from=build ${GIT_FOLDER}/supplemental/apache2/ /etc/apache2/
COPY --from=build /usr/local/lib/libxl* /usr/local/lib/
RUN ldconfig

###################
# copy wkhtmltox #
###################
COPY --from=build ${GIT_FOLDER}/wkhtmltox*.deb ./

####################
# install binaries #
####################
Expand All @@ -228,7 +233,6 @@ RUN apt update \
apache2 \
gsfonts \
wget \
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb \
&& apt install --no-install-recommends --no-install-suggests -y ./*.deb \
&& apt remove -y wget \
&& rm -rf /var/lib/apt/lists/*
Expand Down
18 changes: 10 additions & 8 deletions supplemental/docker/qa/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ RUN apt-get install --no-install-recommends --no-install-suggests -y \
libwebp-dev \
libarchive-dev \
rapidjson-dev \
pkg-config
pkg-config \
wget

#####################
# locale generation #
Expand All @@ -52,13 +53,6 @@ RUN locale-gen en_US.utf8
RUN update-locale
RUN export LC_ALL=en_US.utf8

#############################
# libwkhtmltox installation #
#############################
RUN apt-get install --no-install-recommends --no-install-suggests -y wget
RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb
RUN apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox_0.12.5-1.trusty_amd64.deb

###############
# pull PI src #
###############
Expand All @@ -74,6 +68,14 @@ RUN if test -f "./libxl-3.8.4.0/lib64/libxl.so"; then \
&& ldconfig; \
fi

#############################
# libwkhtmltox installation #
#############################
RUN if test -d "./wkhtmltox"; then \
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb \
&& apt install --no-install-recommends --no-install-suggests -y ./wkhtmltox*.deb; \
fi

##################
# save commit id #
##################
Expand Down
1 change: 1 addition & 0 deletions wkhtmltox/readme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder instructs Docker to install wkhtmltox library, otherwise it won't be installed.

0 comments on commit 4597be4

Please sign in to comment.