Yesterday all of sudden I got a weird error during build of my container. I have a few “apt-get update” statements in my dockerfile which keep failing.
I have created a supersmall docker file that shows this behaviour:
FROM resin/%%RESIN_MACHINE_NAME%%-python
RUN apt-get update
The output on the console I get is:
[Info] Building on arm03
[Info] Pulling previous images for caching purposes...
[Success] Successfully pulled cache images
[main] Step 1/68 : FROM resin/raspberrypi3-python
[main] ---> 56e5e6de91ac
[main] Step 2/68 : RUN apt-get update
[main] ---> Running in 3840477524eb
[main] Get:1 http://archive.raspbian.org jessie InRelease [15.0 kB]
[main] Get:2 http://archive.raspberrypi.org jessie InRelease [22.9 kB]
[main] Get:3 http://security.debian.org jessie/updates InRelease [44.9 kB]
[main] Ign http://deb.debian.org jessie InRelease
[main] Get:4 http://deb.debian.org jessie-updates InRelease [7340 B]
[main] Get:5 http://deb.debian.org jessie Release.gpg [2420 B]
[main] Get:6 http://deb.debian.org jessie Release [148 kB]
[main] Get:7 http://archive.raspbian.org jessie/main armhf Packages [13.3 MB]
[main] Get:8 http://archive.raspberrypi.org jessie/main armhf Packages [170 kB]
[main] Get:9 http://archive.raspbian.org jessie/contrib armhf Packages [49.5 kB]
[main] Get:10 http://security.debian.org jessie/updates/main armhf Packages [795 kB]
[main] Get:11 http://archive.raspbian.org jessie/non-free armhf Packages [106 kB]
[main] Get:12 http://archive.raspbian.org jessie/rpi armhf Packages [1297 B]
[main] Get:13 http://archive.raspbian.org jessie/firmware armhf Packages [1208 B]
[main] Get:14 http://deb.debian.org jessie/main armhf Packages [8898 kB]
[main] Fetched 23.6 MB in 13s (1703 kB/s)
[main] W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file)
[main] E: Some index files failed to download. They have been ignored, or old ones used instead.
[main]
[main] Removing intermediate container 3840477524eb
[Info] Uploading images
[main] The command '/bin/sh -c apt-get update' returned a non-zero code: 100
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command '/bin/sh -c apt-get update' returned a non-zero code: 100
[Error] Not deploying release.
remote: error: hook declined to update refs/heads/balena-nocache
To git.resin.io:accounts1/alphar3.git
! [remote rejected] master -> balena-nocache (hook declined)
error: failed to push some refs to 'accounts1@git.resin.io:accounts1/alphar3.git'
Seems like updating one of the sources is failing. Any of you guys experiencing this as well?
You might want to start by using the newer balenalib images. Also, have you tried the same reproduction steps on a different device, and on a different network?
I had a similar issue, and updating to a newer base image fixed the issue. I have also been using the RUN install_packages method rather than RUN apt-get, which appears to have some good optimizations if available but I don’t have a good link to documentation on it. example: