du512926 2019-08-10 00:18
浏览 345

Docker PHP7 CLI Debian Buster如何安装包php-imagick?

I have a PHP-CLI Docker image of Debian Buster and would like to install php-imagick package but with command:

Dockerfile:

RUN apt-get install -y php-imagick

I get an error:

Package php-imagick is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'php-imagick' has no installation candidate

running before:

RUN apt-get update -y && apt-get upgrade -y

did not help.

how come there is no package candidate for php-imagick?
how to install and enable imagick extension for this PHP Docker image?

Dockerfile to replicate issue:

FROM php:7.3-buster

RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y php-imagick

build command

docker build --tag testimage .
  • 写回答

1条回答 默认 最新

  • drfif48428 2019-08-12 21:29
    关注

    Unless you have a good reason not to, using the packages from https://deb.sury.org/ is probably a good idea. The following appears to work:

    FROM debian:buster-slim
    
    USER root
    
    # Get Debian up-to-date
    RUN apt-get update -qq \
        && DEBIAN_FRONTEND=noninteractive apt-get install -y git \
        mariadb-client wget curl \
        ca-certificates lsb-release apt-transport-https gnupg bsdmainutils
    
    RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee -a /etc/apt/sources.list.d/php.list \
        && curl https://packages.sury.org/php/apt.gpg | apt-key add - \
        && apt-get update -qq \
        && DEBIAN_FRONTEND=noninteractive apt-get install -y php7.3 php7.3-common php7.3-cli \
        php7.3-mysql php7.3-curl php7.3-xml php7.3-mbstring \
        php7.3-intl php7.3-redis php7.3-zip \
        php7.3-imagick supervisor
    
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值