-
Notifications
You must be signed in to change notification settings - Fork 38.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker build fails with 'could not find bridge docker0' #33745
Comments
I know there's issue #1806 but that seems to deal more with the security implications of having to run the container in privileged mode. |
We do not recommend consuming the host docker daemon within pods because k8s assumes complete control over the host docker daemon. It can and might delete images as they are being built. Networking configurations are not guaranteed to compatible with upstream docker distribution. |
@vishh that sounds pretty neat. Do you happen to have an example yaml of this? |
I managed to get this to work now with the following deployment manifest and our own docker-in-docker container:
It doesn't deserve any prize for how docker.sock and docker binary is mounted from the side-car container into the build agent container. Especially that the docker-in-docker container copies files from /usr/local/bin into a mounted directory. Is there a better way for this? I couldn't get overlay nor overlay2 to work with GCI though. Do you need to install the storage drivers in your container? I've based mine on the official Docker one, which can be found at |
Docker info inside the docker-in-docker container looks like
Whereas on the GCI host vm it's:
|
cc @Amey-D on dind with overlay storage driver not working. |
@vishh why do you think this is related to storage driver? I was able to follow almost all the instructions from https://hub.docker.com/_/docker/ successfully, including the one with overlay storage driver:
I say almost because only the following command failed:
which seems to be failing on older Looking at the original error, this may have something to do with the network configuration on k8s node. |
My comment was based on @JorritSalverda's previous comment #33745 (comment)
|
@JorritSalverda Could you please elaborate on "I couldn't get overlay nor overlay2 to work with GCI"? As adityakali pointed out, Docker-in-Docker works on GCI with overlayfs storage driver. Also note that GCI ships with Docker 1.11.2, whereas your manifest appears to base 1.12. I'm not sure if that's the problem though. |
I managed to get overlay fs to work in the Docker in Docker image. I use the following in the manifest to get this to work:
I've tested it with a number of builds an everything seems to be running fine, so I'll close this issue. |
*BUG REPORT *
When trying to run
docker build
inside a container with docker mounted into it the build starts of fine, but fails to create and endpoint on network bridge docker0 as soon as the build process hits the first RUN command.The agents are deployed with the following manifest (leaving out a couple of envvars that don't seem relevant for sake of brevity):
Inside the container I make a docker group and add the go user that runs the build to that group so it works without sudo.
The interesting thing is that it used to work fine when running a vm based on the following image:
With this container manifest:
The big difference seems to lie in the networking setup for the container vm and the container engine cluster. We also tested it with host networking, but that didn't make a difference.
A couple of stats about the Kubernetes / Container Engine cluster that might help.
Kubernetes version
1.3.5 on Google Container Engine using the non-GCI host image. GCI fails in a different way and has a different gid for the docker group.
Docker info
Network bridge
OS info
The text was updated successfully, but these errors were encountered: