我的Dockerfile是:
FROM python:3.9-slim-bullseye
RUN apt-get update && apt-get install \
--no-install-recommends -qq -y \
apt-utils \
poppler-utils \
libjpeg-dev \
libcairo2-dev \
pdftk \
ghostscript \
autoconf-archive \
pkg-config \
libpng-dev \
libtiff5-dev \
zlib1g-dev \
imagemagick \
wget \
procps \
curl \
locales \
libicu-dev \
libpango1.0-dev \
g++ \
make \
tesseract-ocr \
tesseract-ocr-por \
tesseract-ocr-osd
我可以在我的机器(Ubuntu 20.04 和 Docker 版本 19.03.10)上构建它sudo docker build -t foo .
,但我无法在 Travis CI 上执行相同操作:
Errors were encountered while processing:
libpaper1:amd64
libgs9:amd64
ghostscript
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends -qq -y apt-utils poppler-utils libjpeg-dev libcairo2-dev pdftk ghostscript autoconf-archive pkg-config libpng-dev libtiff5-dev zlib1g-dev imagemagick wget procps curl locales libicu-dev libpango1.0-dev g++ make tesseract-ocr tesseract-ocr-por tesseract-ocr-osd libc6 libgs9 ucf libpaper1' returned a non-zero code: 100
有关 libpaper1 的部分日志:
Setting up libpaper1:amd64 (1.1.28+b1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Creating config file /etc/papersize with new version
stat: cannot statx '/etc/papersize.dpkg-inst': Operation not permitted
dpkg: error processing package libpaper1:amd64 (--configure):
installed libpaper1:amd64 package post-installation script subprocess returned error exit status 1
有关 libgs9 的部分日志:
dpkg: error processing package libgs9:amd64 (--configure):
dependency problems - leaving unconfigured
有关 ghostscript 的部分日志:
dpkg: dependency problems prevent configuration of ghostscript:
ghostscript depends on libgs9 (= 9.53.3~dfsg-7+deb11u1); however:
Package libgs9:amd64 is not configured yet.
我尝试了以下操作但没有成功:
RUN dpkg --configure -a && apt-get -f install
并且:
RUN apt-get clean && apt-get update && apt-get install --fix-broken
RUN apt-get install --assume-yes --no-install-recommends -qq \
我的一部分.travis.yaml
:
jobs:
include:
- stage: Build temporary docker image
services:
- docker
language: minimal
if: type = pull_request AND branch = master
script:
- source ci_scripts/gcloud_setup.sh
- gcloud docker -- pull gcr.io/foo/bar
- docker build --cache-from gcr.io/foo/bar:latest -t bar_temp .
- docker tag bar_temp gcr.io/foo/bar
- gcloud docker -- push gcr.io/foo/bar
我这里漏掉了什么吗?如何安装这些软件包而不会出现错误?