Closed Mykola-Veryha closed 4 years ago
It's not the best solution but with this line:
USER root
it's working
FROM surnet/alpine-wkhtmltopdf:3.9-0.12.5-full as wkhtmltopdf
FROM wodby/drupal-php:7.4-dev-4.15.3
USER root
# Install dependencies for wkhtmltopdf
RUN apk add --no-cache \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.1 \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
ttf-ubuntu-font-family \
&& apk add --no-cache --virtual .build-deps \
msttcorefonts-installer \
\
# Install microsoft fonts
&& update-ms-fonts \
&& fc-cache -f \
\
# Clean up when done
&& rm -rf /tmp/* \
&& apk del .build-deps
# Copy wkhtmltopdf files from docker-wkhtmltopdf image
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /usr/bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/wkhtmltoimage /usr/bin/wkhtmltopdf
COPY --from=wkhtmltopdf /bin/libwkhtmltox* /usr/bin/
You should be able to change the user back after the RUN command. This way there shouldn't be a security issue