-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Network Issue with using RUN in dockerfile in Windows Builds #4960
Comments
Can share the sample repro |
@profnandaa updated the issue description with the requested info. |
Confirming the repro, DNS resolution issues too even when using |
Yes, the documentation is missing the section on setting up proper CNIs. @profnandaa, my old guide contains setup steps for the CNI. In short, we need to add to the docs instructions on downloading the CNI binaries, writing the config for the CNI and setting up the service to use the CNIs. After the CNIs are set up, you can register buildkitd as a service using: & "C:\Program Files\buildkit\buildkitd.exe" `
--register-service `
--service-name buildkitd `
--debug `
--containerd-worker=true `
--containerd-cni-config-path="C:\Program Files\containerd\cni\conf\0-containerd-nat.conf" `
--containerd-cni-binary-dir="C:\Program Files\containerd\cni\bin" `
--log-file="C:\Windows\Temp\containerd.log
# Make buildkitd dependent on containerd
sc.exe config buildkitd depend= containerd You can remove the Edit: @profnandaa there are pre-built CNI binaries. We can add to the docs steps on downloading those. No need to build from source. |
Thank you @gabriel-samfira and @profnandaa Although, it looks to work inconsistently. one run I'd get a working build, the next, I'd get Containerd logs doesnt show anything promising that I can see with debugging turned on. Not sure if it's a containerd issue, CNI, or buildkit. But it's a work in progress! |
@ehuizar1028 -- seen a similar issue previously reported here containerd/containerd#5729 ; it's to do with the CNI, and perhaps around the CIDR config. I'm currently testing out various setups to make sure we have one definitive guide for setting this up. The guide should most likely live close to source at https://github.com/microsoft/windows-container-networking and linked from buildkit, containerd, etc. Working on that. |
@ehuizar1028 -- could you share with me the dump for your: Get-HnsNetwork | where { $_.Name -eq 'nat' } and the contents of your
|
try: stop-service buildkitd
stop-service containerd
Get-HnsEndpoint | Remove-HnsEndpoint
start-service containerd
start-service buildkitd and see if that fixes it. Containerd will recreate the network in HNS automatically. |
UPDATE:
However, it fails when you add the wrong |
buildkit uses the containerd executor to spin up containers. We need to simply point it to the containerd CNI config and CNI dir and it should be fine. |
@gabriel-samfira -- sounds good. Sending in the documentation update. Will also add the part for registering |
Adds details on how to quickly set up CNI / networking for Windows, and hooking it with `buildkitd` using the `--containerd-cni-config-path` and `--containerd-cni-binary-dir` flags. Also adds a note on running `buildkitd` as a Windows Service. fixes moby#4960 Signed-off-by: Anthony Nandaa <[email protected]> Co-authored-by: Gabriel Adrian Samfira <[email protected]>
Adds details on how to quickly set up CNI / networking for Windows, and hooking it with `buildkitd` using the `--containerd-cni-config-path` and `--containerd-cni-binary-dir` flags. Also adds a note on running `buildkitd` as a Windows Service. fixes moby#4960 Signed-off-by: Anthony Nandaa <[email protected]> Co-authored-by: Gabriel Adrian Samfira <[email protected]>
Adds details on how to quickly set up CNI / networking for Windows, and hooking it with `buildkitd` using the `--containerd-cni-config-path` and `--containerd-cni-binary-dir` flags. Also adds a note on running `buildkitd` as a Windows Service. fixes moby#4960 Signed-off-by: Anthony Nandaa <[email protected]> Co-authored-by: Gabriel Adrian Samfira <[email protected]>
Adds details on how to quickly set up CNI / networking for Windows, and hooking it with `buildkitd` using the `--containerd-cni-config-path` and `--containerd-cni-binary-dir` flags. Also adds a note on running `buildkitd` as a Windows Service. fixes moby#4960 Signed-off-by: Anthony Nandaa <[email protected]> Co-authored-by: Gabriel Adrian Samfira <[email protected]>
Adds details on how to quickly set up CNI / networking for Windows, and hooking it with `buildkitd` using the `--containerd-cni-config-path` and `--containerd-cni-binary-dir` flags. Also adds a note on running `buildkitd` as a Windows Service. fixes moby#4960 Signed-off-by: Anthony Nandaa <[email protected]> Co-authored-by: Gabriel Adrian Samfira <[email protected]>
Adds details on how to quickly set up CNI / networking for Windows, and hooking it with `buildkitd` using the `--containerd-cni-config-path` and `--containerd-cni-binary-dir` flags. Also adds a note on running `buildkitd` as a Windows Service. fixes moby#4960 Signed-off-by: Anthony Nandaa <[email protected]> Co-authored-by: Gabriel Adrian Samfira <[email protected]>
Running a buildctl process, and it seems that the RUN command has no network access.
I can’t run nslookup, ping, and can’t resolve any DNS when attempting to run anything that involves making a request.
This works fine using docker. And using other commands such as ADD works also.
This would result in the inability to resolve the DNS
community.chocolatey.org
The remote name could not be resolved: community.chocolatey.org
On latest default Windows EKS AMI 2019 and 2022, but also on different variations of Windows 2019 + 2022 we build in-house.
Also latest containerd, buildkit versions
buildkit 13.2 and containerd 1.7.17
I installed docker on the same host and it runs fine there.
The text was updated successfully, but these errors were encountered: