'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 1:[1]

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: Nerctl cp command

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mayank Upasak