<p>I'm trying to copy a local Python file to a running container on Kubernetes and it fails:</p>

<pre><code>$ kubectl cp /path/to/file.py namespace/pod:/path/in/container/file.py
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
command terminated with exit code 2
</code></pre>

<p>I know the <code>tar</code> binary must be available in the container, and it is.</p>

<p>Does anyone know what's going on here and how I can solve this?</p>

<p><strong>UPDATE:</strong></p>

<p>After some more testing I can confirm that this only happens on nodes that run <code>nvidia-docker</code> rather than the normal <code>docker</code>. When piping things into <code>kubectl exec</code> on these nodes the stream is always empty.</p>

<p>So the following command yields an empty file in the pod running on a GPU-enabled node while the file is non-empty on other nodes without GPU support:</p>

<pre><code>cat nonempty_file.txt | kubectl exec -i pod -- tee /home/jovyan/empty_file.txt 
</code></pre>

<p>This has been tested using the exact same image/container on both nodes.</p>

Simon G.
<p>Problem is solved by updating  EKS AMI version.</p>
<p>Please install new release: <a href="https://github.com/awslabs/amazon-eks-ami/releases" rel="nofollow noreferrer">eks-ami-releases</a>.</p>
<p>See: <a href="https://github.com/awslabs/amazon-eks-ami/issues/453" rel="nofollow noreferrer">eks-ami-kubectl</a>.</p>
