I have a Kubernetes pod based on a Jenkins/slave container to which I mount a Docker socket and a Docker binary file with necessary kernel modules in privileged mode.
Inside that pod I build a Docker image, in which I run Docker container. Inside that container I don't have Internet connection at all because the pod container uses a flannel network (198.x.x.x)
and that container uses bridged docker network (172.x.x.x)
, which is not available inside the pod container.
How can I make the Internet available inside the second container which is being created inside the Kubernetes pod container?
Using Docker API in Jenkins pipeline is not a solution for me as long as it limits output of error logs and I can not commit changes made in the second container because of immediate removing of that container after build.