[Blocking issue] Dockerfile.template no more building after no change (cache problem ?)

support

#1

To be clear on what I’m facing : I’ve just had an error when pushing changes, so :

  • I’ve made clean clone in a new dir,
  • I’ve added a “test.txt” file to be able to push,
  • on pushing a Dockerfile and conf which lead to succesful build yesterday, it fails.

Here are the relevant part of my Dockerfile which fail

# Install Telegraf
 && wget -O /tmp/telegraf.deb https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}_armhf.deb \
 && dpkg -i /tmp/telegraf.deb \
 && rm /tmp/telegraf.deb \
 # We use systemd, not init.d services
 && rm -Rf /etc/init.d/telegraf \ 
 && cp /usr/lib/telegraf/scripts/telegraf.service /usr/lib/systemd/system/telegraf.service \

In build logs, I get :

[Build]    Preparing to unpack /tmp/telegraf.deb ...
[Build]    Unpacking telegraf (1.3.5-1) ...
[Build]    Setting up telegraf (1.3.5-1) ...
[Build]    invoke-rc.d: could not determine current runlevel
[Build]    invoke-rc.d: policy-rc.d denied execution of restart.
[Build]    cp: cannot create regular file '/usr/lib/systemd/system/telegraf.service': No such file or directory
[Build]    Removing intermediate container 8daa276c206c
[Error]   

So I guess if I was able to build with no cache, it would solve the problem, is it possible ?

UPDATE : after trying to deploy an almost empty Dockerfile to clear the cache, I’ve tried to build again and it failed again. So now, all my devices are empty and I can’t deploy my app.

When I run the instructions one by one on any device, it works. Could the reason be the /usr/lib/systemd/system directory is not existent at the moment of the copy ? (it did exist yesterday and the days before though).


#3

I’ve solved my issue but it’s a real concern to use a docker base solution in production.

So basically what I think happened : my Dockerfile has not changed and your Debian stretch Dockerfile has not changed BUT for any reason, systemd has been modified and its directory layer has changed, /usr/lib/systemd/system does not exist any more (maybe it’s still recognized but it’s not created at systemd install). So here, using /lib/systemd/system directory instead of /usr/lib/systemd/system solved the broken build problem.


#4

Hi @Tristan107 - what FROM were you using? In general our base images with tags like stretch can get rebuilt and dependencies can be updated. If you want to use a fixed version that ensures you’ll always be using the same image, you can use our tags with a timestamp - those do not change (e.g. stretch-20170909 in https://hub.docker.com/r/resin/raspberrypi3-debian/tags/ )


#5

Ok, thanks for the tip, I’ll do this.