Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegraf 0.12.1-1 fails to install inside a ubuntu 16.04 docker container #1092

Closed
jgeiger opened this issue Apr 25, 2016 · 1 comment
Closed

Comments

@jgeiger
Copy link

jgeiger commented Apr 25, 2016

Just ran into this issue trying to build some containers.

This works when the container is based off 14.04

Failure trace:

docker build -t nexia/telegraf .
Sending build context to Docker daemon 6.656 kB
Step 1 : FROM nexia/ubuntu
 ---> a1fad2287f5b
Step 2 : MAINTAINER jgeiger@gmail.com
 ---> Using cache
 ---> a54630b8de2a
Step 3 : ENV TELEGRAF_VERSION telegraf_0.12.1-1
 ---> Running in 6833e0ebb0af
 ---> 260677a5ecb7
Removing intermediate container 6833e0ebb0af
Step 4 : ENV TELEGRAF_FILE ${TELEGRAF_VERSION}_amd64.deb
 ---> Running in 0b16555f9abe
 ---> 008b9f102f43
Removing intermediate container 0b16555f9abe
Step 5 : USER root
 ---> Running in b5ba4dd0f976
 ---> 4d429a601285
Removing intermediate container b5ba4dd0f976
Step 6 : WORKDIR /tmp
 ---> Running in b0ac29271859
 ---> a7d9551ddd97
Removing intermediate container b0ac29271859
Step 7 : RUN wget --quiet http://get.influxdb.org/telegraf/${TELEGRAF_FILE}       && apt-get -qq -y update       && dpkg -i ${TELEGRAF_FILE}       && apt-get autoremove       && apt-get clean       && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

 ---> Running in a5fdd7a783c2
Selecting previously unselected package telegraf.
(Reading database ... 13051 files and directories currently installed.)
Preparing to unpack telegraf_0.12.1-1_amd64.deb ...
Unpacking telegraf (0.12.1-1) ...
Setting up telegraf (0.12.1-1) ...
Created symlink /etc/systemd/system/telegraf.service, pointing to /lib/systemd/system/telegraf.service.
Created symlink /etc/systemd/system/multi-user.target.wants/telegraf.service, pointing to /lib/systemd/system/telegraf.service.
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
dpkg: error processing package telegraf (--install):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 telegraf
The command '/bin/sh -c wget --quiet http://get.influxdb.org/telegraf/${TELEGRAF_FILE}       && apt-get -qq -y update       && dpkg -i ${TELEGRAF_FILE}       && apt-get autoremove       && apt-get clean       && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*' returned a non-zero code: 1
make: *** [build] Error 1

Dockerfile

  FROM nexia/ubuntu          
  MAINTAINER jgeiger@gmail.com

  ENV TELEGRAF_VERSION=telegraf_0.12.1-1
  ENV TELEGRAF_FILE=${TELEGRAF_VERSION}_amd64.deb

  USER root                  

  WORKDIR /tmp               

  RUN wget --quiet http://get.influxdb.org/telegraf/${TELEGRAF_FILE} \
        && apt-get -qq -y update \      
        && dpkg -i ${TELEGRAF_FILE} \   
        && apt-get autoremove \
        && apt-get clean \   
        && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

  COPY docker-entrypoint.sh /entrypoint.sh
  RUN chmod +x /entrypoint.sh

  WORKDIR $HOME              

  ENTRYPOINT [ "tini", "--", "/entrypoint.sh"] 

  CMD [ "telegraf" ]      

Success on 14.04:

docker build -t nexia/telegraf .
Sending build context to Docker daemon 6.656 kB
Step 1 : FROM nexia/ubuntu
 ---> 8fb94a1373a1
Step 2 : MAINTAINER jgeiger@gmail.com
 ---> Running in e328e5bfb954
 ---> d5fdcedab0d9
Removing intermediate container e328e5bfb954
Step 3 : ENV TELEGRAF_VERSION telegraf_0.12.1-1
 ---> Running in 0ca2958a69a6
 ---> 679cb095bec8
Removing intermediate container 0ca2958a69a6
Step 4 : ENV TELEGRAF_FILE ${TELEGRAF_VERSION}_amd64.deb
 ---> Running in 2ab8656f0404
 ---> a4fcab3d2232
Removing intermediate container 2ab8656f0404
Step 5 : USER root
 ---> Running in ef19159bc646
 ---> 65ff80f5d459
Removing intermediate container ef19159bc646
Step 6 : WORKDIR /tmp
 ---> Running in bbab285d33e3
 ---> 63f2efe8e153
Removing intermediate container bbab285d33e3
Step 7 : RUN wget --quiet http://get.influxdb.org/telegraf/${TELEGRAF_FILE}       && apt-get -qq -y update       && dpkg -i ${TELEGRAF_FILE}       && apt-get autoremove       && apt-get clean       && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 ---> Running in 38c6201a71f7
Selecting previously unselected package telegraf.
(Reading database ... 14489 files and directories currently installed.)
Preparing to unpack telegraf_0.12.1-1_amd64.deb ...
Unpacking telegraf (0.12.1-1) ...
Setting up telegraf (0.12.1-1) ...
 Adding system startup for /etc/init.d/telegraf ...
   /etc/rc0.d/K20telegraf -> ../init.d/telegraf
   /etc/rc1.d/K20telegraf -> ../init.d/telegraf
   /etc/rc6.d/K20telegraf -> ../init.d/telegraf
   /etc/rc2.d/S20telegraf -> ../init.d/telegraf
   /etc/rc3.d/S20telegraf -> ../init.d/telegraf
   /etc/rc4.d/S20telegraf -> ../init.d/telegraf
   /etc/rc5.d/S20telegraf -> ../init.d/telegraf
invoke-rc.d: policy-rc.d denied execution of restart.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 ---> e928c12c0e6e
Removing intermediate container 38c6201a71f7
Step 8 : COPY docker-entrypoint.sh /entrypoint.sh
 ---> 708fe64d74b9
Removing intermediate container 9fd723846d11
Step 9 : RUN chmod +x /entrypoint.sh
 ---> Running in 6d572c5fef03
 ---> 8e641346b993
Removing intermediate container 6d572c5fef03
Step 10 : WORKDIR $HOME
 ---> Running in 9d140454bf42
 ---> beae08871ce2
Removing intermediate container 9d140454bf42
Step 11 : ENTRYPOINT tini -- /entrypoint.sh
 ---> Running in 817099ee2850
 ---> 6ba1d900778b
Removing intermediate container 817099ee2850
Step 12 : CMD telegraf
 ---> Running in 2532900bcaf1
 ---> 17d63c902d33
Removing intermediate container 2532900bcaf1
Successfully built 17d63c902d33
@sparrc
Copy link
Contributor

sparrc commented Apr 25, 2016

this is because you don't have systemd in the containers......this has been fixed already with #1022

you can use the nightlies if you need the fix sooner (https://influxdata.com/downloads/)

@sparrc sparrc closed this as completed Apr 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants