From manpages:
docker container rm
will remove one or more containers from the host
node. The container name or ID can be used. This does not remove
images.
docker container kill
: The main process inside each container
specified will be sent SIGKILL, or any signal specified with option
–signal.
Is a container a running instance of an image?
So do docker container rm
and docker container kill
effectively achieve the same: the container will stop existing?
What are their differences?
What is "the main process inside a container"?
Is a container run exactly as a process in the host machine?
Thanks.
Best Answer
If you run a container..
eg
It looks like it cleans up afterwards...
But it doesn't it's still there.
This can be cleaned up with the
rm
commandSo:
docker kill
will kill a container.docker rm
will clean up a terminated container.They are different things.
Note: you can tell containers to auto-clean:
Then you don't need to manually
rm
.