Inkscape는 로컬 컴퓨터에서는 작동하지만 도커 컨테이너에서는 작동하지 않습니다.

Inkscape는 로컬 컴퓨터에서는 작동하지만 도커 컨테이너에서는 작동하지 않습니다.
FROM python:3.10

RUN apt-get update && apt-get install -y inkscape

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 5000

CMD ["gunicorn", "--workers", "8", "--bind", "0.0.0.0:8484", "wsgi:app"]

위는 내 도커 파일입니다.

아래는 내 코드입니다

   image_name = re.sub(r'[^\w\s-]', '', title)
             svgchart  = chart_pygal.render()
             inkscape_process = subprocess.Popen(['inkscape', '-z', '-e', '-', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
             png_data, error = inkscape_process.communicate(input=svgchart)
             png_io = BytesIO(png_data)
             return send_file(png_io ,mimetype='image/png', download_name=image_name+'.png', as_attachment=True) 

svg를 png로 변환하는 중인데 내 컴퓨터에서는 제대로 작동하지만 docker 컨테이너에서는 작동하지 않습니다. 다음 오류가 발생합니다. 죄송합니다. 형식이 지원되지 않거나 파일이 이미 다운로드되었고 다운로드한 이미지 크기가 0kb이기 때문에 사진에서 이 파일을 열 수 없습니다.

관련 정보