How to copy files to a LXC container
Once you’ve created a LXC container using a command like
lxc_launch_example.sh
lxc launch ubuntu:18.04 mycontaineryou can push files to the container using
lxc_file_push_example.txt
lxc file push myfile.zip mycontainer/root/This will copy the local file myfile.zip to /root/myfile.zip on the container. Ensure that your path ends with /, since lxc file push myfile.zip mycontainer/root will show this error message:
example.txt
Error: Path already exists as a directory: File too largeIn that case, add a slash (/) to the end of your destination path (e.g. mycontainer/root => mycontainer/root/).
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow