Я застрял на этом. Я создаю образ докера с помощью этого файла Dockerfile
#
# 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 ожидает, что файл /etc/newrelic-infra.yml
будет там, как выделено строкой Failed to connect to bus: No such file or directory
Есть ли причина, по которой файлы, скопированные в / etc /, не работают? Это базовое изображение, которое я использую?