Reputation: 2684
I'm facing an unexpected error when running docker build
, and I say unexpected because I haven't changed my Dockerfile
for a while, and it had worked fine for the last time two weeks ago, but now I'm getting the following error:
failed to create endpoint optimistic_spence on network bridge: failed to add the host (veth9fc3a03) <=> sandbox (veth15abfd6) pair interfaces: operation not supported
In case it is of any help:
docker ps
sudo systemctl status docker
)docker build -t user/repo:tag .
Dockerfile
looks like:
FROM alpine:3.4
LABEL version="current version"
LABEL description="A nice description."
LABEL maintainer="[email protected]"
RUN apk update && apk add \
gcc \
g++ \
make \
git \
&& git clone https://gitlab.com/user/repo.git \
&& cd repo \
&& make \
&& cp program /bin \
&& rm -r /repo \
&& apk del g++ make git
WORKDIR /tmp
ENTRYPOINT ["program"]
Does anybody understand what is going on? Thank you!
EDIT
When combined with the --network
option, the error changes a little, but it won't fix the problem. For example, --network=host
gives the following:
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/community: temporary error (try again later)
WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory 2 errors; 11 distinct packages available
The command '/bin/sh -c apk update && apk add gcc g++ make git && git clone https://gitlab.com/user/repo.git && cd repo && make && cp program /bin && rm -r /repo && apk del g++ make git' returned a non-zero code: 2
Upvotes: 11
Views: 19420
Reputation: 2220
Just to add to the possible causes. For me (and probably @testix) it was because i did a system upgrade (archlinux), so my kernel modules got upgraded, but i was still running the old kernel, so modules could not be loaded. You can try do modprobe a random module:
modprobe vcan
modprobe: FATAL: Module vcan not found in directory /lib/modules/6.2.7-arch1-1
This means that you have to reboot, (or use --network
if you can get away with it).
Upvotes: 3
Reputation: 313
Had the same error and systemctl restart docker
nor pruning og images & system did not do it for me, I ended up rebooting my computer which seems o have resolved the issue.
Upvotes: 19
Reputation: 2684
Two times I have faced this issue and the way to fix it has always been the same. I'm posting in case it can be of any help for somebody:
For those using systemd in Linux, systemctl restart did not the job for me. I had to stop and start docker to make it work. After that, I could login and pull images again.
Upvotes: 1
Reputation: 3691
It looks that something wrong happened with any docker network bridge
and it doesn't let you to create the same because is "zombie".
Try with following steps:
docker network prune
, and if it doesn't work, try with:docker system prune
<-- Careful, this also will purge your named volumes contents, i.e, volumes that are not assigned to a container. So, if you have volumes assigned to a container, you should have to re-build/create containers./etc/init.d/docker restart
Show me what happens and let's see, actually I need more info about your problem if it doesn't solve it to you.
Upvotes: 6