[lxc-devel] What's the correct way to send binary files or directories into containers with pylxd?

Cheng Kun nypdmax at hotmail.com
Wed Apr 26 08:29:09 UTC 2017


Hello developers,


I'm using python 2.7 with pylxd 2.2.3 and lxd 2.12. I could use 'lxc file push' to send files or directories easily. But with pylxd, the put function of the file manager requires a destination path and file data. I did some tests and found out I could send text contents into a container, but if I read a binary file then sent the data to the destination file in a container, then there would be a defference between the source file and destination one.


And I've no idea how to send a direcory. The only way I could think of now is to recursively read each file and recreate them in the container(or execute bash cmd to do such things). But again how should I handle the binary files?


So, what's the correct way to send binary files or even directories into containers with pylxd?


Thanks,

Kun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170426/6f592024/attachment.html>


More information about the lxc-devel mailing list