Not sure what exactly the cause is of this, but the docker image at snapcore/snapcraft:stable currently is failing for us reliabily because it can’t resolve some IP address needed for the package linux-libc-dev:
15:25:18 Err:92 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-libc-dev amd64 4.4.0-135.161
15:25:18 404 Not Found [IP: 91.189.91.23 80]
...
15:25:25 Fetched 160 MB in 7s (20.2 MB/s)
15:25:25 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.4.0-135.161_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
15:25:25
15:25:25 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
You can reproduce this locally by attempting to perform the build for the EdgeX project by doing the following:
which will launch the docker container and attempt to run the build. Also note that this is only reproducible on x86 (obvious since the docker image for snapcraft is only published for x86).
Sure, but this is the upstream docker image that causes this, we don’t call apt update anywhere.
Unless I’m using the image wrong… This is all we’re doing with the dockerfile:
FROM snapcore/snapcraft:stable
# include all of the build context inside /build
COPY . /build
# run the entrypoint.sh script to actually perform the build when the container is run
WORKDIR /build
ENTRYPOINT [ "/build/snap/entrypoint.sh" ]
and entrypoint.sh is:
#!/bin/bash -e
# Required by click.
export LC_ALL=C.UTF-8
export SNAPCRAFT_SETUP_CORE=1
# build the snap
cd /build
snapcraft clean
snapcraft
# other stuff specific to the project
I guess it’s confusing to me that we would need to call apt update in a docker image that supposedly already contains a working snapcraft…
If that is the case then it sounds like the right thing to do is to update the docker image that snapcraft publishes so it does an apt update when the container starts.
your build-packages/stage-packages definitely come from the archive using the local package lists of the build machine, so these should be updated before you fire off the build to make sure to have the latest meta info …
Hello!
I see is quite old post, but I just felt into this issue and I did not find a solution…
I don’t have any other way to build snap at the moment, do you have any recommendation?