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

cp support #613

Closed
ibuildthecloud opened this issue Apr 12, 2018 · 16 comments · Fixed by #2151
Closed

cp support #613

ibuildthecloud opened this issue Apr 12, 2018 · 16 comments · Fixed by #2151
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@ibuildthecloud
Copy link

FEATURE REQUEST

mount/umount is more powerful than cp, but just as buildah is more powerful than a Dockerfile, you still support a Dockerfile. cp is such a common task it would be nice if it was supported.

@mheon
Copy link
Member

mheon commented Apr 12, 2018

I can see making a cp command that mounts (if unmounted), copies, and then unmounts (if you initially did a mount) under the hood. We have the code to do all three, combining them shouldn't be that difficult.

@mheon
Copy link
Member

mheon commented Apr 12, 2018

If you were thinking of a more Docker-style copy via stdin, I'm not specifically opposed to that, but the simpler approach would be to reuse the existing mount-based code.

@rhatdan
Copy link
Member

rhatdan commented Apr 13, 2018

@ibuildthecloud so you want podman cp to work.
I have no problem implementing this my just execing the CP command, but putting the effort/support into actually doing cp seems a lot of work. And docker cp is one of the things I tend to show as a reason why podman/buildah mount is better.

@rhatdan
Copy link
Member

rhatdan commented Jun 4, 2018

@ibuildthecloud Any comment on our suggestions? Or should I close this?

@mheon
Copy link
Member

mheon commented Jun 4, 2018

@rhatdan I think this is still a good enhancement, we should leave it open

@vrothberg
Copy link
Member

vrothberg commented Jun 13, 2018

I can pick that up if you want to, and would follow @mheon's inital proposal to map cp to mount, cp, unmount. Are you okay with that?

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2018

Im fine with it. My only concern is handling multiple mounts/unmounts and making sure we handle this correctly.

@mheon
Copy link
Member

mheon commented Jun 13, 2018

I think mount/unmount session-based concurrency would need to happen first

@vrothberg
Copy link
Member

My only concern is handling multiple mounts/unmounts and making sure we handle this correctly.
[...]
I think mount/unmount session-based concurrency would need to happen first

@mheon, @rhatdan, I think we handle this now correctly, do we? I think the internal counter solves most of it. But I am not sure if multiple unmounts should break the cp or not?

@mheon
Copy link
Member

mheon commented Nov 19, 2018 via email

@rhatdan
Copy link
Member

rhatdan commented Nov 19, 2018

I agree.

@vrothberg
Copy link
Member

Great, this seems ready to be implemented 👍

@ktdreyer
Copy link
Contributor

I was using podman today, and I was sad about the lack of "cp" parity with docker. Now I'm happy to find this issue.

@rhatdan
Copy link
Member

rhatdan commented Nov 21, 2018

Would be a simple bash script to generate the equivalent. (I am not a big fan of docker cp). But I guess we will have to implement it.

mnt=$(podman mount $ctr)
cp $mnt/var/lib/foobar /tmp
cp /etc/mydata.conf $mnt/etc
podman umount $ctr

@rhatdan
Copy link
Member

rhatdan commented Dec 22, 2018

@QiWang19 Could you look into adding this command.

@mheon
Copy link
Member

mheon commented Dec 22, 2018

I think this is definitely more urgent now that podman mount is broken for rootless

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants