-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Pass --network=host during docker build #1771
Comments
This sounds more like an EKS configuration issue, than a problem in Skaffold. Besides, could you provide some debug log output? |
The output log is that the yarn install on my jenkins job fails to fetch files from the repository due to connectivity issue. I tried |
Have you tried adjusting the mtu inside your containers? Using a too large mtu can lead to black-hole connections, if ICMP mtu discovery is blocked. |
I'm having the same issue, when skaffold build during jenkins the container have no internet access and fail. I ended up using |
@corneliusweig How to adjust mtu? |
@romil-punetha e.g. https://mlohr.com/docker-mtu/ |
Having the same issue. When I use skaffold build -f skaffold.yaml, there is only the loopback interface within the container. However, when I use docker build --network=host . I have the regular interfaces and can access network as expected. Edit: ip link output from the container when I use skaffold build -f skaffold.yaml
|
@remzisenel Can you check what interfaces are set up when using Can you also check if the network setting is configured in |
It is an EKS configuration issue they disabled the bridge network. Take a look at: awslabs/amazon-eks-ami#183 |
@moshid Thanks for demystifying that 🤦♂️ So I would recommend to try enabling the bridge network again (see the issue found by @moshid). If that does not work, there is currently no way to pass this flag from skaffold to docker. However, you can try a very dirty hack to inject the flag: put this file as #!/bin/bash
if [[ "$1" = 'build' ]]; then
exec /path/to/real/docker build --network=host "${@:2}"
else
exec /path/to/real/docker "$@"
fi Then use the CLI docker in skaffold by build:
tagPolicy:
envTemplate:
template: "{{.DOCKER_REGISTRY}}/romil-punetha/doorman:{{.VERSION}}"
artifacts:
- image: doorman
context: .
docker: {}
local:
useDockerCLI: true # <<<<<<<<<<<<<<< |
Thank you for filing this, and for the workarounds! |
Docker version 19.03.9, build 9d98839 "--network=host" is the only solution. |
I am having the same issue with the same version of docker. Does not build with bridge network. Only builds with host network. But docker run seems fine (containers are able to access internet). Is this a known issue? |
@GodaProjects This sounds like an issue with your local configuration rather than a Skaffold issue. |
Had this issue today as well. |
I just wanted to +1 this issue and add a comment for my use case. The service I'm working on is written in Python. When building the docker image for it we install some packages using I've been experimenting with skaffold today and this seems to be a blocking issue for me. Without being able to ask skaffold to run docker with this flag it cannot run the docker build successfully. |
ref #5638 |
When using skaffold build during jenkins, the docker build is failing because the containers aren't able to connect to the internet. However, I tried ssh-ing into the machines and ran docker build --network=host and it worked. Is there any provisioning to provide the --network flag to skaffold build ?
Expected behavior
skaffold build should succeed.
Actual behavior
The build is failing as no command with internet as a requirement is passing.
Information
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: