Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

cannot access containerd socket "/run/containerd/containerd.sock": no such file or directory #2008

Unanswered
aishwaryabk asked this question in Q&A
Discussion options

I am trying to create a container inside a container using nerdctl command:

root@69adc10b8807:/home/jenkins/workspace/# nerdctl version
Client:
 Version: v0.8.0
 Git commit: d57846db4a90540bc41e4683cd1a9f1e9e99170a
FATA[0000] cannot access containerd socket "/run/containerd/containerd.sock": no such file or directory
root@69adc10b8807:/home/jenkins/workspace/# nerdctl run -it ubuntu
FATA[0000] cannot access containerd socket "/run/containerd/containerd.sock": no such file or directory
root@69adc10b8807:/home/jenkins/workspace/# ls /run/
lock utmp
root@69adc10b8807:/home/jenkins/workspace/# find / -name containerd.sock
root@69adc10b8807:/home/jenkins/workspace/#

The /run/containerd/containerd.sock is not present.

You must be logged in to vote

Replies: 4 comments 4 replies

Comment options

sudo systemctl enable --now containerd

You must be logged in to vote
1 reply
Comment options

This command is run inside the container of quay.io/powercloud/inbound-agent:4.10-3.2 image and so sudo: systemctl: command not found

Comment options

You need more configuration. I believe that this discussion will help you

You must be logged in to vote
2 replies
Comment options

Hi @fahedouch, I tried following the doc (https://github.com/containerd/nerdctl/blob/main/docs/rootless.md).
I created a new user and tried installing containerd using the rootless approach.

root@69adc10b8807:/home/jenkins/workspace/# su aish
$ sudo /usr/local/bin/containerd-rootless-setuptool.sh install
[sudo] password for aish:
[ERROR] Refusing to install rootless containerd as the root user
$ /usr/local/bin/containerd-rootless-setuptool.sh install
[ERROR] Needs systemd (systemctl --user)
$
$ systemctl
sh: 4: systemctl: not found

But this does not work. Is there any other approach for solving this? Or am I missing anything?

Comment options

hi @aishwaryabk , Sorry but do not understand the relation between setting up a rootless environment and the original issue to access containerd socket from the container

Comment options

Getting the same error after I started appending the grub file and rebooted my system for setting up bpf lsm for some use case and this happend

sudo vi /etc/default/grub
Append the following to the GRUB_CMDLINE_LINUX variable and save.
GRUB_CMDLINE_LINUX="lsm=lockdown,capability,yama,apparmor,bpf"
sudo update-grub
image
image
image
image

You must be logged in to vote
0 replies
Comment options

Specify the mount volume when building the container, rather than mounting it through an image of an existing mount volume

apiVersion: v1
kind: Pod
metadata:
 name: build-image
spec:
 containers:
 - name: build-image
 image: ubuntu:v1.0.0	
 command: ["/bin/sh", "-c", "sleep infinity"]
 volumeMounts:
 - name: containerd-sock
 mountPath: /run/containerd/containerd.sock
 nodeSelector:
 kubernetes.io/hostname: cluster-worker
 restartPolicy: Always
 volumes:
 - name: containerd-sock
 hostPath:
 path: /run/containerd/containerd.sock
 type: Socket
You must be logged in to vote
1 reply
Comment options

Hello. May I ask if your image includes nerdctl? Can you access the host's containerd through nerdctl inside the Pod?

I hope to connect to the host's containerd from the privileged container of Pod, so as to support the commit operation on the running containers. I've already read a lot of discussions.

I'm wondering if this discussions point to the correct answers🙏.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /