https://rancher.com/ logo
#rancher-desktop
Title
# rancher-desktop
m

mysterious-potato-12169

11/19/2022, 3:47 PM
Is there a good way to share the containerd socket into a container in RD? I'm doing a volume mount
-v "/run/containerd/containerd.sock:/run/containerd/containerd.sock"
but am getting the following error:
Copy code
FATA[0000] failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/containerd/containerd.sock" to rootfs at "/run/containerd/containerd.sock": stat /run/containerd/containerd.sock: no such file or directory: unknown
f

fast-garage-66093

11/19/2022, 8:25 PM
The socket is in a non-default location:
/run/k3s/containerd/containerd.sock
So try
-v /run/k3s/containerd/containerd.sock:/run/containerd/containerd.sock
m

mysterious-potato-12169

11/19/2022, 8:27 PM
Yeah, I tried that, but then I start to get file not found issues.
Seems like it is more complicated than docker: https://github.com/containerd/nerdctl/issues/272
f

fast-garage-66093

11/19/2022, 8:28 PM
Yeah, you cannot run
nerdctl
from inside a container; it needs filesystem access to the image store as well
You could use
crictl
instead, if that has the functionality you need
m

mysterious-potato-12169

11/19/2022, 8:29 PM
I'm trying to use it for a build system, to have job isolation.
I'm not familiar with
crictl
f

fast-garage-66093

11/19/2022, 8:29 PM
Maybe using moby and the docker cli will be simpler?
m

mysterious-potato-12169

11/19/2022, 8:30 PM
Yeah, probably. I use
nerdctl
for everything else in my development and pipelines, so was trying to avoid multiple tools.
f

fast-garage-66093

11/19/2022, 8:31 PM
I think
nerdctl build
will still run the build itself in containers (via buildkitd), so I'm not sure why you would need to run
nerdctl
itself in a container
m

mysterious-potato-12169

11/19/2022, 8:31 PM
I'm trying to run a build agent inside a container, and have it spawn additional containers for job / tooling isolation.
I may just run the agent on the host and then spawn the containers from there. Would be much simpler.
👍 1
Thanks @fast-garage-66093!
f

fast-garage-66093

11/19/2022, 8:33 PM
You are welcome!
554 Views