LoginSignup
3
0

PHP Docker GD ライブラリのインストール

Last updated at Posted at 2023-08-04

環境

  • PHP: 8.2.8

Dockerfile(差分だけ)

RUN apt-get update \
  && apt-get -y install --no-install-recommends \
    libpng-dev libjpeg-dev \
  && docker-php-ext-configure gd --with-jpeg \
  && docker-php-ext-install \
    -j$(nproc) gd

--with-png オプションはデフォルトで組み込まれたから廃止されたそうです(詳しくないです)
--with-jpeg jpegを使うためにはこのオプションが必要でした。
-j$(nproc) nprocコマンドはCPUコア数が返り、-jオプションは指定したCPUコア数で並列ビルドを行うための設定になるようです。

参考

https://tech.kurojica.com/archives/27414/
https://github.com/docker-library/php/issues/912

3
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
3
0