Notes - nerdctl

Alternative aux commandes :

docker

docker-compose

podman

crictl

ctr

Voir :

https://www.youtube.com/watch?v=fMOT4761_VQ

https://github.com/containerd/nerdctl?tab=readme-ov-file#additional-documents

https://blog.devops.dev/podman-vs-nerdctl-whats-the-deal-8f9511fb975d

https://rootlesscontaine.rs/getting-started/containerd/

Old :

https://thenewstack.io/containers/how-to-deploy-containers-with-nerdctl/

export NERDCTL_EXPERIMENTAL=0
$ nerdctl info
WARNING: AppArmor profile "nerdctl-default" is not loaded.
Use 'sudo nerdctl apparmor load' if you prefer to use AppArmor with rootless mode.
This warning is negligible if you do not intend to use AppArmor.

sudo nerdctl apparmor load
nerdctl compose up

Debug dockerfile

nerdctl builder debug .

list namespaces

nerdctl namespace ls

Connection a container to multiple networks at once nerdctl run --net foo --net bar

nerdctl --address /run/k3s/containerd/containerd.sock --namespace k8s.io ps #ou CONTAINERD_ADDRESS=/run/k3s/containerd/containerd.sock

Pb

Err provided file is not a console

Exited (137)

1 errors:\nprovided file is not a console

Solution

apt-get install expect

~/.config/dinit.d/kind

type = process # command = $HOME/bin/nerdctl start --attach kind-control-plane command = unbuffer $HOME/bin/nerdctl start --attach kind-control-plane stop-command = $HOME/bin/nerdctl stop kind-control-plane restart = false logfile = /home/jibe/log/kind.log stop-timeout = 120

Préfixer la commande par unbuffer