Skip to content

Instantly share code, notes, and snippets.

@mwikala
Created September 18, 2022 23:06
Show Gist options
  • Save mwikala/22001f9e8a1adc5052220b1f722f0c44 to your computer and use it in GitHub Desktop.
Save mwikala/22001f9e8a1adc5052220b1f722f0c44 to your computer and use it in GitHub Desktop.
Add wkhtmltopdf to Laravel Sail (Docker) on M1 Macbook
FROM --platform=linux/amd64 ubuntu:20.04
# ... Other commands
# Install dependencies
RUN echo "deb http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-cache policy libssl1.0-dev \
&& apt-get install -y libssl1.0-dev libfontconfig zlib1g libfreetype6 libxrender1 libxext6 libx11-6 \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install wkhtmltopdf binaries
RUN curl -L -o wkhtmltopdf.tar.xz https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
&& tar -xf wkhtmltopdf.tar.xz \
&& mv wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf \
&& chmod +x /usr/local/bin/wkhtmltopdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment