Is there a way to download the container image from kuberentes pod? Let say we have multiple containers running in a Pod and we want to download the container so we can do some stuff offline in that container. The reason we want to download from kubernets pod directly since most of the environment settings are already set and the container should able to start with a single docker command.
It is like asking docker compose file from the kubernetes pod environment.
You cannot do it by Kubernetes itself, by any special command, etc. Here is a discussion about it.
But you still can use docker commit
command right on the node and save a state of your container as a new image like that:
kubectl describe $POD
. You need Container ID
and Node
values.docker commit $CONTAINER_ID saved-image:1
.