<p>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 Kubernetes pod directly since most of the environment settings are already set and the container should able to start with a single docker command.</p>
<p>It is like asking docker compose file from the kubernetes pod environment.</p>

<p>You cannot do it by Kubernetes itself, by any special command, etc. Here is a <a href="https://github.com/kubernetes/kubernetes/issues/14561" rel="noreferrer">discussion</a> about it.</p>

<p>But you still can use <code>docker commit</code> <a href="https://docs.docker.com/engine/reference/commandline/commit/" rel="noreferrer">command</a> right on the node and save a state of your container as a new image like that:</p>

<ol>
<li>Get container's ID, and node where it is running in detailed pod information: <code>kubectl describe $POD</code>. You need <code>Container ID</code> and <code>Node</code> values.</li>
<li>Connect to a node which you got on a previous step and call: <code>docker commit $CONTAINER_ID saved-image:1</code>.</li>
</ol>
