我也在docker容器中遇到了imagemagick的问题。我共享我的docker配置的一部分。当我在docker容器中进行测试时,出了什么问题,我从imagemagick看到有关字体丢失的错误。如果您使用轻量级的smth映像(例如linux-alpine或smth映像),则映像不能具有任何重要的工具,例如本地计算机或VM。当然,您需要将其安装在Docker容器中,而不是在服务器上的vm中安装
在docker中安装imagemagic非常简单:apk --update add imagemagick
我的docker文件的一部分。我安装了一些重要的字体,imagemagic很好用。但它可以解决另一个问题,因为尝试在docker中使用imagemagick时出现此错误
流产生空缓冲区
# the first thing we specify in a Dockerfile is the base image
FROM keymetrics/pm2:latest-alpine
RUN yarn global add pm2@latest
# Install image preview generator tools
RUN apk add --no-cache file
RUN apk --update add imagemagick
# Install fonts
RUN apk --no-cache add msttcorefonts-installer fontconfig && \
update-ms-fonts && \
fc-cache -f