dockercontainersmountcontainerd

How containerd copy a file from host to a running container?


I find that I can use ctr snapshot mount to copy a file from a container to a host. But how can I copy a file from a host to the container using containerd? I used golang to write some code to start a container, but I can't find any documentation about copying host files to a running container.


Solution

  • As of now there is no provision as such with either with ctr or crictl cli to copy a host file to a running container as we have with docker cli (eg: docker cp).

    Though there is a project under containerd known as nerdctl which is trying to emulate the same.

    nerdctl is a Docker-compatible CLI for containerd.

    Link for reference: nerdctl cp command