![Inkscape는 로컬 컴퓨터에서는 작동하지만 도커 컨테이너에서는 작동하지 않습니다.](https://linux55.com/image/220884/Inkscape%EB%8A%94%20%EB%A1%9C%EC%BB%AC%20%EC%BB%B4%ED%93%A8%ED%84%B0%EC%97%90%EC%84%9C%EB%8A%94%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%EB%A7%8C%20%EB%8F%84%EC%BB%A4%20%EC%BB%A8%ED%85%8C%EC%9D%B4%EB%84%88%EC%97%90%EC%84%9C%EB%8A%94%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
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이기 때문에 사진에서 이 파일을 열 수 없습니다.