How to run a container? #2328
-
I have Rancher Desktop with containerd and nerdctl installed and I created a container with the name maindebian (nerdctl run -it --name maindebian debian), then I installed some tools on it, but I cant seem to find a way to run that exact container after I exited it. So if I run that command and I exit the container (so I stop it) and then I want to run it again I don't know how (I tried nerdctl run maindebian, but it tries to search for that image on docker.io is there a flag to disable searching on docker.io for that command?). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The only way I'm aware of doing this is to run your container in daemon mode, i.e.
You can then get a shell in your container with
The Also note you can then |
Beta Was this translation helpful? Give feedback.
The only way I'm aware of doing this is to run your container in daemon mode, i.e.
You can then get a shell in your container with
The
/bin/sleep inf
is there because the container needs to have some active process, otherwise it just exits. A better thing to run would probably be the system init, though I'm not sure how that would work out with this image. I used to do this successfully with an alpine image - see https://github.com/adamkpickering/alpine-dev for my setup.Also note you can then
nerdctl start
andnerdctl stop
the running container. And you can install any dependencies you want in th…