Dockerfile ADD指令无法添加文件
2019-3-9 7:54:4
收藏:0
阅读:112
评论:1
我遇到了这个问题。我正在通过以下 Dockerfile 构建 Docker 图像
#
# Nginx 自定义域名 Https Dockerfile
#
# 构建具有自动 SSL 功能的 OpenResty nginx 图像
# 参考: https://github.com/GUI/lua-resty-auto-ssl
#
FROM openresty/openresty:latest-xenial
RUN apt-get update
RUN apt-get install -y apt-transport-https
RUN apt-get install -y --no-install-recommends apt-utils
RUN echo "license_key: 64553f3xxxxxxxxx" | tee -a /etc/newrelic-infra.yml
RUN curl https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | apt-key add -
RUN printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt xenial main" | tee -a /etc/apt/sources.list.d/newrelic-infra.list
RUN cat /etc/apt/sources.list.d/newrelic-infra.list
RUN echo "license_key: 64553fxxxxxxxxxxxx" | tee -a /etc/newrelic-infra.yml
RUN cat /etc/newrelic-infra.yml
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq newrelic-infra
....
还有更多,请继续查看以下问题
我通过以下方式运行它
docker build -t XXXXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/qwilr-codebuild-base:latest .
其输出为:
Sending build context to Docker daemon 41.47kB
Step
1/19 : FROM openresty/openresty:latest-xenial
....
Step 9/19 : RUN echo "license_key: 64553f38xxxxxxxx" | tee
-a /etc/newrelic-infra.yml
---> Using cache
---> 77cd0ece8528
Step 10/19 : RUN cat /etc/newrelic-infra.yml
---> Using cache
---> 2cb1a27b4d8b
Get:1 https://download.newrelic.com/infrastructure_agent/linux/apt xenial/main amd64 newrelic-infra amd64 1.2.15 [4679 kB]
Fetched 4679 kB in 14s (325 kB/s)
Selecting previously unselected package newrelic-infra.
(Reading database ... 15601 files and directories currently installed.)
Preparing to unpack .../newrelic-infra_1.2.15_amd64.deb ...
Unpacking newrelic-infra (1.2.15) ...
Setting up newrelic-infra (1.2.15) ...
Failed to connect to bus: No such file or directory
dpkg: error processing package newrelic-infra (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
newrelic-infra
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c DEBIAN_FRONTEND=noninteractive apt-get install -yq newrelic-infra' returned a non-zero code: 100
问题似乎在于添加了 newrelic-infra.yml 文件却无法正常工作。我还尝试使用 COPY 和 ADD,但仍然无法正常工作。是否有我忽略的一些内容,使得该文件无法出现在接下来的 apt-get install 命令中?
我也使用了 --no-cache 参数运行了一遍,仍然出现相同的错误。我相信关键的失败原因是 newrelic-infra 的安装需要文件 /etc/newrelic-infra.yml,正如 Failed to connect to bus: No such file or directory 所标明的那样。
为什么添加到 /etc/ 目录下的文件会失败呢?是我使用的基础镜像出了问题吗?
点赞
评论区的留言会收到邮件通知哦~
推荐文章
- Lua 虚拟机加密load(string.dump(function)) 后执行失败问题如何解决
- 我想创建一个 Nginx 规则,禁止访问
- 如何将两个不同的lua文件合成一个 东西有点长 大佬请耐心看完 我是小白研究几天了都没搞定
- 如何在roblox studio中1:1导入真实世界的地形?
- 求解,lua_resume的第二次调用继续执行协程问题。
- 【上海普陀区】内向猫网络招募【Skynet游戏框架Lua后端程序员】
- SF爱好求教:如何用lua实现游戏内调用数据库函数实现账号密码注册?
- Lua实现网站后台开发
- LUA错误显式返回,社区常见的规约是怎么样的
- lua5.3下载库失败
- 请问如何实现文本框内容和某个网页搜索框内容连接,并把网页输出来的结果反馈到另外一个文本框上
- lua lanes多线程使用
- 一个kv数据库
- openresty 有没有比较轻量的 docker 镜像
- 想问一下,有大佬用过luacurl吗
- 在Lua执行过程中使用Load函数出现问题
- 为什么 neovim 里没有显示一些特殊字符?
- Lua比较两个表的值(不考虑键的顺序)
- 有个lua简单的项目,外包,有意者加微信 liuheng600456详谈,最好在成都
- 如何在 Visual Studio 2022 中运行 Lua 代码?

看起来这是一个开放的问题。
dpkg error processing package newrelic-infra
此外,该软件包在linux/apt中失踪了。