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

Comments

Projects
None yet
6 participants
@ibuildthecloud
Copy link

commented Apr 12, 2018

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

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Member

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.

@mheon mheon added the enhancement label Apr 24, 2018

@rhatdan

This comment has been minimized.

Copy link
Member

commented Jun 4, 2018

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

@mheon

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2018

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

@vrothberg

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Jun 13, 2018

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

@mheon

This comment has been minimized.

Copy link
Collaborator

commented Jun 13, 2018

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

@vrothberg

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

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

This comment has been minimized.

Copy link
Collaborator

commented Nov 19, 2018

@rhatdan

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

I agree.

@vrothberg

This comment has been minimized.

Copy link
Member

commented Nov 20, 2018

Great, this seems ready to be implemented 👍

@ktdreyer

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2018

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Dec 22, 2018

@QiWang19 Could you look into adding this command.

@mheon

This comment has been minimized.

Copy link
Collaborator

commented Dec 22, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.