Dockerfile ADD文件失败

问题描述 投票:0回答:1

我坚持这个。我正在通过这个dockerfile构建一个docker镜像

#
# Nginx Custom Domain Https Dockerfile
#
# Builds an OpenResty nginx image with auto-ssl capabilities
# See: 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 install期望文件/etc/newrelic-infra.yml在那里,正如行Failed to connect to bus: No such file or directory所强调的那样

有没有理由将复制到/ etc /的文件失败?它是我正在使用的基本图像吗?

docker newrelic
1个回答
0
投票

看起来这是一个悬而未决的问题。 dpkg error processing package newrelic-infra

此外,在linux/apt下缺少包裹

© www.soinside.com 2019 - 2024. All rights reserved.