【发布时间】:2022-06-15 21:51:15
【问题描述】:
系统
开发环境:Ubuntu 22.04
产品环境:debian 10.12 64bit / Linux 4.19.0-20-amd64
我的节点后端文件夹中的 Dockerfile
FROM node:slim
# Install wkhtmltopdf
RUN apt-get update
RUN apt-get install -y wkhtmltopdf
RUN npm install -g pm2@latest
WORKDIR /var/api
COPY . .
RUN npm i
EXPOSE 10051-10053
# Start PM2 as PID 1 process
ENTRYPOINT ["pm2-runtime"]
CMD ["process.json"]
在我的开发系统 (Ubuntu 22.04) 上构建此文件时,它工作正常。
但是,将它部署到我的服务器并让它构建,我得到以下输出:
Building backend
Sending build context to Docker daemon 159.2kB
Step 1/10 : FROM node:slim
---> 6c8b32c67190
Step 2/10 : RUN apt-get update
---> Using cache
---> b28ad6ee8ebf
Step 3/10 : RUN apt-get install -y wkhtmltopdf
---> Running in 2f76d2582ac0
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package wkhtmltopdf
The command '/bin/sh -c apt-get install -y wkhtmltopdf' returned a non-zero code: 100
ERROR: Service 'backend' failed to build : Build failed
我尝试过的
- 在我的服务器上单独运行
apt-get install -y wkhtmltopdf可以正常安装软件包。
- 为
/etc/apt/sources.list添加了不同的存储库
- 我知道它的包https://packages.debian.org/buster/wkhtmltopdf (?)
- 一些疑难解答。
【问题讨论】:
标签: linux docker ubuntu debian apt