zaggash / docker-netdata

Live Monitoring tool in a container based on alpine from linuxserver.io
1 stars 2 forks source link

You are missing a dependency in the build process. #1

Open jeremyjpj0916 opened 6 years ago

jeremyjpj0916 commented 6 years ago

I just tested with alpine 3.6 and for one small step you need:

RUN \
  apk add --no-cache \
    **openrc \**
    python \
ssmtp \

Otherwise one of the install blurbs reads Failed rather than Ok. it contains the rc-update call this script makes....

Even with that corrected when I try to deploy this to kubernetes as a docker container I get the following error in the end...:

--- starting netdata --- 
 --- Start netdata --- 
[/opt/netdata]# /sbin/service netdata stop 
 * ERROR: netdata stopped by something else
 FAILED   

[/opt/netdata]# /sbin/service netdata restart 
 * WARNING: netdata is already starting
 FAILED   

[/opt/netdata]# /sbin/service netdata start 
 * WARNING: netdata is already starting
 FAILED   

[/opt/netdata]# stop_all_netdata 
 OK   

[/opt/netdata]# /opt/netdata/bin/netdata 
 OK   

  ^
  |.-.   .-.   .-.   .-.   .-.   .  netdata                          .-.   .-
  |   '-'   '-'   '-'   '-'   '-'   is installed and running now!  -'   '-'  
  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->

 OK   

WARNING: Ignoring APKINDEX.84815163.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.24d64ab1.tar.gz: No such file or directory
F1118 06:43:52.626096 1 builder.go:204] Error: build error: The command '/bin/sh -c apk add --no-cache openrc python ssmtp docker jq libmnl libuuid python curl netcat-openbsd lm_sensors nodejs py-mysqldb py-psycopg2 py-yaml && curl -s https://my-netdata.io/kickstart-static64.sh >/tmp/kickstart-static64.sh && bash /tmp/kickstart-static64.sh --dont-wait && cd ~ && apk del --purge build-dependencies && rm -rf /var/cache/apk/* /tmp/* /etc/init.d' returned a non-zero code: 1

Any ideas?

jeremyjpj0916 commented 6 years ago

Interesting, I decided to break up your giant 1 RUN statment into separate ones:

  # cleanup
RUN cd ~ && \
  apk del --purge \
    build-dependencies && \
rm -rf /var/cache/apk/* /tmp/* /etc/init.d

For some reason the above is what fails... the cleanup lol..

F1118 07:09:25.472658 1 builder.go:204] Error: build error: The command '/bin/sh -c cd ~ && apk del --purge build-dependencies && rm -rf /var/cache/apk/ /tmp/ /etc/init.d' returned a non-zero code: 1

I wonder if its okay to not do cleanup?

If I remove cleanup the build works fine, but when i go to deploy I get error: expecting a resource on kubernetes... I wonder if I need a CMD command at the end of the dockerfile...

zaggash commented 6 years ago

Hi,

It's been a while since I used this image. I'll take a look next week. But you gave to know this image use s6 overlay to handle the signals.

And yes its important to run the cleanup on the same layer. Otherwise you do not really remove the files on the image, they stay in the previous layer.

zaggash commented 6 years ago

BTW I'm refactoring my images. I'll do it step by step.

I'll close this issue when the image will be up and running again with my new setup.