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

Needs command that do not capture content ? #4

Closed
YanzhaoLi opened this issue Oct 10, 2019 · 4 comments · Fixed by #19
Closed

Needs command that do not capture content ? #4

YanzhaoLi opened this issue Oct 10, 2019 · 4 comments · Fixed by #19

Comments

@YanzhaoLi
Copy link
Contributor

When we copy multiple files which needs sudo capability, scp doesn't work. In this case, we could execute sudo command to copy these files to /tmp and then execute scp. Thus, we need dummy command that does not capture content.

@vladimirvivien
Copy link
Contributor

@YanzhaoLi thanks for the feedback.
Can you please paste an example Diagnostics.file here to show an example of what you are talking about. Thanks!

@YanzhaoLi
Copy link
Contributor Author

YanzhaoLi commented Oct 11, 2019

@vladimirvivien

# To Copy multiple root-owned files
# Since we have no root user, we couldn't scp root-owned files such as container logs.
# Fortunately, we have sudo privilege, we make a trick to sudo copy these logs into where we can scp
CAPTURE /bin/bash -c 'mkdir -p /tmp/containers; for file in $(ls /var/log/containers/); do sudo cat /var/log/containers/$file > /tmp/containers/$file; done'
COPY /tmp/containers
CAPTURE /usr/bin/rm -rf /tmp/containers

In this case, the two CAPTURE command would generate two useless files. How about add a RUN command which only run command instead of generating files

@vladimirvivien
Copy link
Contributor

@YanzhaoLi thanks for this issue.
I am looking into improving how commands are executed.
This is a great case to help with that. Looking into a solution Soon.

@vladimirvivien
Copy link
Contributor

@YanzhaoLi Your requested feature is in!

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

Successfully merging a pull request may close this issue.

2 participants