containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Apache License 2.0
8.24k stars 614 forks source link

Error run nerdctl Windows 11 #1087

Closed aleksey005 closed 2 years ago

aleksey005 commented 2 years ago

Description

I use example https://docs.rancherdesktop.io/how-to-guides/hello-world-example

Steps to reproduce the issue

  1. $ nerdctl build --tag helloworld:v1.0 .

Describe the results you received and expected

MINGW64 ~/hello-world

time="2022-06-02T21:04:40Z" level=error msg="buildctl needs to be installed and buildkitd needs to be running, see https://github.com/moby/buildkit" error="2 errors occurred:\n\t failed to ping to host unix:///run/buildkit-default/buildkitd.sock: exit status 1\n\t failed to ping to host unix:///run/buildkit/buildkitd.sock: exit status 1\n\n" time="2022-06-02T21:04:40Z" level=fatal msg="no buildkit host is available, tried 2 candidates: 2 errors occurred:\n\t failed to ping to host unix:///run/buildkit-default/buildkitd.sock: exit status 1\n\t failed to ping to host unix:///run/buildkit/buildkitd.sock: exit status 1\n\n"

What version of nerdctl are you using?

nerdctl version 0.19.0

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

Rancher Desktop 1.3.0

Host information

amd64, 8vcpu 16 Gb RAM

AkihiroSuda commented 2 years ago

Please report to https://github.com/rancher-sandbox/rancher-desktop/issues

aleksey005 commented 2 years ago

ok, thank you.

Naoero commented 2 years ago

Same here but on OSX Big Sur.

AkihiroSuda commented 2 years ago

Same here but on OSX Big Sur.

@Naoero ~Please report to Rancher Desktop~ ~https://github.com/rancher-sandbox/rancher-desktop/issues~

(EDIT: saw you already reported https://github.com/rancher-sandbox/rancher-desktop/issues/2481)

billmurrin commented 1 month ago

The thing causing my buildkit not to run on Windows under WSL was related to iptables not being installed in Ubuntu. Once installed, things ran smoothly.

Terminal Output

[redacted]:~/containerdemo$ CONTAINERD_NAMESPACE=default containerd-rootless-setuptool.sh install-buildkit-containerd
[WARNING] File already exists, skipping: /home/[redacted]/.config/systemd/user/default-buildkit.service
[INFO] Starting systemd unit "default-buildkit.service"
+ systemctl --user start default-buildkit.service
+ sleep 3
+ systemctl --user --no-pager --full status default-buildkit.service
● default-buildkit.service - BuildKit (Rootless)
     Loaded: loaded (/home/[redacted]/.config/systemd/user/default-buildkit.service; enabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Thu 2024-10-17 12:12:05 PDT; 1s ago
    Process: 45809 ExecStart=/usr/local/bin/containerd-rootless-setuptool.sh nsenter -- buildkitd --oci-worker=false --containerd-worker=true --containerd-worker-rootless=true --addr=unix:///run/user/1000//buildkit-default/buildkitd.sock --root=/home/[redacted]/.local/share/buildkit-default --containerd-worker-namespace=default --containerd-worker-net=bridge (code=exited, status=1/FAILURE)
   Main PID: 45809 (code=exited, status=1/FAILURE)

Oct 17 12:12:05 [redacted] systemd[387]: default-buildkit.service: Failed with result 'exit-code'.
+ set +x
[ERROR] Failed to start default-buildkit.service. Run `journalctl -n 20 --no-pager --user --unit default-buildkit.service` to show the error log.
[ERROR] Before retrying installation, you might need to uninstall the current setup: `/usr/local/bin/containerd-rootless-setuptool.sh uninstall; /usr/local/bin/rootlesskit rm -rf /home/[redacted]/.local/share/containerd`

[redacted]:~/containerdemo$ journalctl -n 20 --no-pager --user --unit default-buildkit.service
Oct 17 12:12:10 [redacted] systemd[387]: default-buildkit.service: Main process exited, code=exited, status=1/FAILURE
Oct 17 12:12:10 [redacted] systemd[387]: default-buildkit.service: Failed with result 'exit-code'.
Oct 17 12:12:12 [redacted] systemd[387]: default-buildkit.service: Scheduled restart job, restart counter is at 3.
Oct 17 12:12:12 [redacted] systemd[387]: Started default-buildkit.service - BuildKit (Rootless).
Oct 17 12:12:12 [redacted] containerd-rootless-setuptool.sh[46245]: buildkitd: plugin type="buildkit-cni-bridge" failed (add): failed to locate iptables: exec: "iptables": executable file not found in $PATH

[redacted]:~/containerdemo$ sudo apt install iptables

[redacted]:~/containerdemo$ CONTAINERD_NAMESPACE=default containerd-rootless-setuptool.sh install-buildkit-containerd
[WARNING] File already exists, skipping: /home/[redacted]/.config/systemd/user/default-buildkit.service
+ systemctl --user --no-pager --full status default-buildkit.service
● default-buildkit.service - BuildKit (Rootless)
     Loaded: loaded (/home/[redacted]/.config/systemd/user/default-buildkit.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-10-17 12:15:04 PDT; 3s ago
   Main PID: 57527 (buildkitd)
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/default-buildkit.service
             └─57527 buildkitd --oci-worker=false --containerd-worker=true --containerd-worker-rootless=true --addr=unix:///run/user/1000//buildkit-default/buildkitd.sock --root=/home/[redacted]/.local/share/buildkit-default --containerd-worker-namespace=default --containerd-worker-net=bridge

Oct 17 12:15:04 [redacted] systemd[387]: default-buildkit.service: Scheduled restart job, restart counter is at 79.
Oct 17 12:15:04 [redacted] systemd[387]: Started default-buildkit.service - BuildKit (Rootless).
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=info msg="found worker \"36fxjwhosku2poq9tvyznbzx9\", labels=map[org.mobyproject.buildkit.worker.containerd.namespace:default org.mobyproject.buildkit.worker.containerd.uuid:96a7e08c-5cb1-4c21-9191-28377331a25f org.mobyproject.buildkit.worker.executor:containerd org.mobyproject.buildkit.worker.hostname:[redacted] org.mobyproject.buildkit.worker.network:cni org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/386]"
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=info msg="found 1 workers, default=\"36fxjwhosku2poq9tvyznbzx9\""
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=warning msg="currently, only the default worker can be used."
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=info msg="running server on /run/user/1000//buildkit-default/buildkitd.sock"
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=warning msg="failed to release network namespace \"slh9tgdct1ffq4mil3d0a5hdt\" left over from previous run: plugin type=\"buildkit-cni-bridge\" failed (delete): running [/sbin/iptables -t nat -D POSTROUTING -s 10.10.9.41 -j CNI-e51d2ba55415c365195db06c -m comment --comment name: \"buildkit\" id: \"slh9tgdct1ffq4mil3d0a5hdt\" --wait]: exit status 4: iptables v1.8.10 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root)\n"
+ systemctl --user enable default-buildkit.service
[INFO] Installed "default-buildkit.service" successfully.
[INFO] To control "default-buildkit.service", run: `systemctl --user (start|stop|restart) default-buildkit.service`

[redacted]:~$ systemctl --user status default-buildkit.service
● default-buildkit.service - BuildKit (Rootless)
     Loaded: loaded (/home/[redacted]/.config/systemd/user/default-buildkit.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-10-17 12:15:04 PDT; 25s ago
   Main PID: 57527 (buildkitd)
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/default-buildkit.service
             └─57527 buildkitd --oci-worker=false --containerd-worker=true --containerd-worker-rootless=true --addr=unix:///run/user/1000//buildkit-default/buildkitd.sock --root=/home/[redacted]/>

Oct 17 12:15:04 [redacted] systemd[387]: default-buildkit.service: Scheduled restart job, restart counter is at 79.
Oct 17 12:15:04 [redacted] systemd[387]: Started default-buildkit.service - BuildKit (Rootless).
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=info msg="found worker \"36fxjwhosku2poq9tvyznbzx9\", labels=map[org.mobyproject.b>
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=info msg="found 1 workers, default=\"36fxjwhosku2poq9tvyznbzx9\""
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=warning msg="currently, only the default worker can be used."
Oct 17 12:15:04 [redacted] containerd-rootless-setuptool.sh[57527]: time="2024-10-17T12:15:04-07:00" level=info msg="running server on /run/user/1000//buildkit-default/buildkitd.sock"

Hope this helps.