As you all know if we use docker to build image inside container we have to mount "-v
/var/run/docker.sock:/var/run/docker.sock"
, how does nerdctl handle that with container-d ?
I am planning to use nerdctl Instead of kaniko , my workflows changes are heavy if I use kaniko .
Asked
Active
Viewed 954 times
0

Rajendar Talatam
- 250
- 1
- 12
1 Answers
1
Though it's not recommended, by mounting the containerd's socket, you can do the same thing.
-v /var/run/containerd/containerd.sock:/var/run/containerd/containerd.sock
And you also need to install nerdctl on the container in some way (copying binary files in the Dockerfile, or mounting a directory which nerdctl.tar.gz exists and extracting it just the same as the host).

Daigo
- 815
- 1
- 5
- 16
-
So you are mounting node level socket to the container socket so there is no point in doing this right again we will come into the same issue right if you Mount node level socket to container – Rajendar Talatam Dec 06 '21 at 16:17
-
@Daigo why is it not recommended? Kubernetes is removing the ability to mount docker.sock, so I assumed I would need to do this with containerd.sock, but I'm curious why it would not be recommended? – Novaterata Nov 09 '22 at 01:14