Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get data out of a container? #181

Open
doronbehar opened this issue Mar 15, 2023 · 2 comments
Open

How to get data out of a container? #181

doronbehar opened this issue Mar 15, 2023 · 2 comments

Comments

@doronbehar
Copy link

I want to get a ZIP file of a directory found in a cntr container - a logs directory of a failing Nix Build. I tried:

sudo cntr attach -t command cntr-/nix/store/...-${name} -- zip -r - build/source/tests/_logs > tests_logs.zip

But it doesn't work - the ZIP file generated is a text file with the text:

zip error: Invalid command arguments (cannot write zip file to terminal)
@Mic92
Copy link
Owner

Mic92 commented Mar 15, 2023

Can you not copy first and than zip it? Otherwise try to put a "bash -c 'zip ... | cat'" construct in place. Maybe cntr should not create a pseudo terminal if the output is not a terminal...

@doronbehar
Copy link
Author

What do you mean by "put a bash -c 'zip ... | cat' construct in place"? Do you mean to use cntr exec? I'm not sure how to use it for this purpose...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants