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

mysterious-potato-12169

11/12/2022, 5:25 PM
Hey there. Is there an easy way to pass environment variables to
nerdctl
? For example, I want to do something like
export CONTAINERD_NAMESPACE=<http://k8s.io|k8s.io>
to allow standard builds to be used in k8s. Right now I am modifying the
nerdctl
script in
$HOME/.rd/bin/nerdctl
to manually include that env variable, but that seems like a hack. This is all in an attempt to get
nerdctl
to behave more closely to
docker
. Any help is appreciated! Thanks.
m

miniature-advantage-69986

11/15/2022, 3:56 PM
have you tried creating a nerdctl.toml file and setting your config in there? See: https://github.com/containerd/nerdctl/blob/main/docs/config.md
m

mysterious-potato-12169

11/15/2022, 4:59 PM
@miniature-advantage-69986 I did not, but I assume I'd have to update that inside the lima-vm where nerdctl runs. Setting the
env:
in the
overrides.yaml
proved to be quite simple.
s

steep-airplane-89460

11/24/2022, 1:57 PM
Yea / new to RD also / and ran into this on Windows as well / built like 10 images till I realized the default image directory is the "default" vs k8s.io / but I found I could save them as .tar and reload them quickly with the k8s.io tag (FYI)
292 Views