3行代码搞定
podman exec space-2 bash -c "apt install -y libwebp-dev libjpeg-dev libpng-dev libxpm-dev libfreetype-dev" podman exec space-2 bash -c "docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir" podman exec space-2 bash -c "docker-php-ext-install gd"
参考文档https://qa.1r1g.com/sf/ask/3442259761/
完整版本
#=============[ljf-start]============= WebBaseUrlpre="http://198.11.177.67:801" SpaceId=2 SpacePath="space/${SpaceId}" DockerName="space-${SpaceId}" rm -rf "/tmp/${SpacePath}" mkdir -p "/tmp/${SpacePath}" chmod 777 "/tmp/${SpacePath}" podman rm -f $DockerName podman run -d --name $DockerName --memory 1G -v "/tmp/${SpacePath}":/tmp -v "/${SpacePath}":"/${SpacePath}" -v "/${SpacePath}":/root -e WebBaseUrlpre="${WebBaseUrlpre}" docker.io/library/php:7.3-fpm /bin/bash -c "curl '${WebBaseUrlpre}/php-fpm/php-fpm.sh'>/tmp/1.sh&&bash /tmp/1.sh&&rm -f /tmp/1.sh" #install-php-ext podman exec $DockerName bash -c "apt update" #gd-install-start podman exec $DockerName bash -c "apt install -y libwebp-dev libjpeg-dev libpng-dev libxpm-dev libfreetype-dev" podman exec $DockerName bash -c "docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir" podman exec $DockerName bash -c "docker-php-ext-install gd" #gd-install-end #restart-php-fpm podman exec $DockerName bash -c "apt install -y procps" podman exec $DockerName bash -c "killall php-fpm" #=============[ljf-end]=============