can I use nerdctl to build Image from inside the cluster

1.1k views Asked by At

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 .

1

There are 1 answers

2
Daigo On

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).