[lxc-users] [LXD] lxc file push/pull

Stéphane Graber stgraber at ubuntu.com
Wed Mar 18 14:49:18 UTC 2015


On Wed, Mar 18, 2015 at 05:06:38PM +1000, Mark Constable wrote:
> https://linuxcontainers.org/lxd/getting-started-cli/ says...
> 
> To pull a file from the container, use:
> lxc file pull /etc/hosts .
> 
> To push one, use:
> lxc file push hosts /tmp
> 
> but how can "lxc file push|pull" know what container to operate on?
> 
> This does not seem to clarify the issue...
> 
> ~ lxc help file
> Manage files on a container.
> 
> lxc file push [--uid=UID] [--gid=GID] [--mode=MODE] <source> [<source>...] <target>
> lxc file pull <source> [<source>...] <target>
> 
> I would kind of expect an explicit 4th <container> argument.

Hmm, looks like lxc file could do with a more descriptive text.

The format for <target> in push or <source> in pull is:
    <container>/<path>

So for container c1:

    lxc file push /source/on/your/machine c1/path/in/the/container
    lxc file pull c1/path/in/the/container /target/on/your/machine

If you're dealing with a remote host, that becomes:

    lxc file push /source/on/your/machine remote:c1/path/in/the/container
    lxc file pull remote:c1/path/in/the/container /target/on/your/machine

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150318/197afb96/attachment.sig>


More information about the lxc-users mailing list