• docker安装php-gd库


    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]=============
  • 相关阅读:
    Linux 常用命令-01
    神经网络工具箱torch.nn -05
    Autograd与计算图-04
    Tensor的索引与变形-03
    Tensor数据类型-00
    Tensor的创建与维度查看-01
    转载:网友对rootfs的理解
    【转载】linux启动流程分析
    windows7 自带计算器bug
    网上同仁对linux文件系统的剖析
  • 原文地址:https://www.cnblogs.com/xiangxisheng/p/15390194.html
Copyright © 2020-2023  润新知