seletskiy/hastur

copy files to container fs

Closed this issue · 6 comments

I would prefer to use this for running integration tests, how I can copy files/directories to container filesystem?

Currently, there are no command for it, but files can be copied to container FS by using cp:

cp <file> <root>/containers/<container-name>/root/<target-path>

Where <root> is /var/lib/hastur or value, passed by flag -r.

it can be possible in runtime?

Yes, of course.

Note, that root/ directory will only contains information specific to this container, e.g. will not contain all files from base package, but only files that was created while container was up and running.

If you want to observe root FS of container as a whole, consider checking .nspawn.root/ dir instead of root/ in the directory <root>/containers/<container-name>. Files, that will be created or modified inside .nspawn.root will be, actually, created inside root/ and modified here.

BTW, handy command like hastur -n <container-name> -F <source>:<target> <source>:<target> ... will be really useful.

Will you implement this feature?

I can add if you find it particulary useful.

Yes, it should be useful.

Also I have another useful idea, do not remove ephemeral container if executed cmd exited with non-zero exit code.