我正在运行一个python脚本来操作图片。我使用ImageMagick绑定python,叫做wand。这是Dockerfile.
FROM ubuntu:latest
RUN apt update
RUN apt install python3 -y
RUN apt-get -y install python3-pip
RUN pip install pillow
RUN pip install wand
WORKDIR /usr/app/src
COPY image_converter.py ./
COPY test_image_converter.py ./
RUN python3 -m unittest test_image_converter.py
这是错误信息
ImportError: MagickWand shared library not found.
You probably had not installed ImageMagick library.
Try to install:
https://docs.wand-py.org/en/latest/guide/install.html
好了,多亏了这个Docker意外安装的imagemagick
RUN DEBIAN_FRONTEND="noninteractive" apt-get install libmagickwand-dev --no-install-recommends -y