1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LaraDock + wkhtmltopdf M1 Mac

Posted at

wkhtmltopdfを使いたいのだ!

どうやらLaraDockの .envほにゃらら_WKHTMLTOPDFtrue にすればいいみたい。

.env
PHP_FPM_INSTALL_WKHTMLTOPDF=true
WORKSPACE_INSTALL_WKHTMLTOPDF=true

いざ、コマンド。

docker-compose up -d nginx mysql workspace

#0 7.770 Preparing to unpack wkhtmltox_0.12.6-1.stretch_arm64.deb ...
#0 7.772 Unpacking wkhtmltox (1:0.12.6-1.stretch) ...
#0 9.386 dpkg: dependency problems prevent configuration of wkhtmltox:
#0 9.386  wkhtmltox depends on libssl1.1; however:
#0 9.386   Package libssl1.1 is not installed.
#0 9.386
#0 9.386 dpkg: error processing package wkhtmltox (--install):
#0 9.386  dependency problems - leaving unconfigured
#0 9.391 Errors were encountered while processing:
#0 9.391  wkhtmltox
------
failed to solve: executor failed running [/bin/sh -c if [ ${INSTALL_WKHTMLTOPDF} = true ]; then     ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)     && apt-get install -yqq       libxrender1       libfontconfig1       libx11-dev       libjpeg62       libxtst6       fontconfig       libjpeg62-turbo       xfonts-base       xfonts-75dpi       wget     && wget "https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_0.12.6-1.stretch_${ARCH}.deb"     && dpkg -i "wkhtmltox_${WKHTMLTOPDF_VERSION}.stretch_${ARCH}.deb"     && apt -f install ;fi]: exit code: 1

libssl1.1がないって怒られた。

解決

php-fpm > Dockerfile のwkhtmltopdfの部分に libssl1.1 を追記。

php-fpm > Dockerfile
#####################################
# wkhtmltopdf:
#####################################

USER root

ARG INSTALL_WKHTMLTOPDF=false
ARG WKHTMLTOPDF_VERSION=0.12.6-1

RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \
    ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
    && apt-get install -yqq \
      libxrender1 \
      libfontconfig1 \
      libx11-dev \
      libjpeg62 \
      libxtst6 \
      fontconfig \
      libjpeg62-turbo \
      xfonts-base \
      xfonts-75dpi \
      wget \
    && wget "http://ftp.jp.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_arm64.deb" \
    && dpkg -i "libssl1.1_1.1.1w-0+deb11u1_arm64.deb" \
    && wget "https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_0.12.6-1.stretch_${ARCH}.deb" \
    && dpkg -i "wkhtmltox_${WKHTMLTOPDF_VERSION}.stretch_${ARCH}.deb" \
    && apt -f install \
;fi

追加したのは↓の2行ね。

&& wget "http://ftp.jp.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_arm64.deb" \
&& dpkg -i "libssl1.1_1.1.1w-0+deb11u1_arm64.deb" \

↓ここからlibssl1.1を直接wget&dpkgてことよ。

Laravelのcomposerで入れてもできなくて:sob:
CPUのアーキテクチャうんぬんで:sob:
apt install しようとしても、libssl1.1ないって怒られるし:sob:
ここに至るまでとても遠回りした、、、すっごい悩んだ、、、
同じことで悩んでいる方の参考になれば幸いです:blush:

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?