0

I'm trying to create a connection to containerd in Rust containerd_client. Using the code sample they gave, which I listed below, I'm getting "permission denied error". If I try "ctr images list", I get the same error. But "sudo ctr images list" works.

let channel = connect("/run/containerd/containerd.sock").await;
let channel = match channel {
Ok(channel) => channel,
Err(error) => panic!("Problem connecting to containerd: {:?}", error),
};

This makes me try setting up containerd to run rootless following this link https://github.com/containerd/containerd/blob/main/docs/rootless.md.

I was able to start containerd using this command

nerdctl run -d --restart=always --name nginx -p 8080:80 nginx:alpine

However, I was not able to access the containerd using ctr even following the advice to run it from the same namespace. The error is

ctr: failed to dial "/run/user/1000/containerd/containerd.sock": context deadline exceeded: connection error: desc = "transport: error while dialing: dial unix:///run/user/1000/containerd/containerd.sock: timeout"

How should I access containerd when it's started rootless?

id -u returned 1000, that's why I'm setting up the URL like that. I also tried swapping out the 1000 with my logged in userid, who has root access, got same error.

Please advise how I can confirm/access containerd when running rootless? Thanks!

Julia
  • 21
  • 3

0 Answers0