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

podman cp #571

Open
avnav0 opened this issue Apr 4, 2023 · 3 comments
Open

podman cp #571

avnav0 opened this issue Apr 4, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@avnav0
Copy link

avnav0 commented Apr 4, 2023

hello, was adviced to create a new issue for a way to use the podman cp command to copy files from a container.

use case:

sometimes, i will make a temp container in order to just copy files that i can build off of (usually configs)

podman run -d --name nginx.vols nginx:1.23.2
cont_num=$(podman ps -aqf "name=nginx.vols")
podman cp $cont_num:/etc/nginx/. /home/user/volumes/nginx
podman stop nginx.vols && podman rm nginx.vols

this would be super useful, since I have to use shell:

    - name: 4. copy config files from temp nginx container into volumes dir
      shell: | 
        cont_num=$(podman ps -aqf "name=nginx.vols")
        podman cp $cont_num:/etc/nginx/. /home/user/volumes/nginx
        podman stop nginx.vols && podman rm nginx.vols
      args:
        executable: /bin/bash
@sshnaidm sshnaidm added the enhancement New feature or request label Apr 5, 2023
@DilasserT
Copy link
Contributor

Hi,

I am also interested in this feature.
@sshnaidm Are you planning to implement this ?
If that is outside your scope, I can make a PR.

It could be a new module like containers.podman.podman_copy ?

@sshnaidm
Copy link
Member

@DilasserT sure, go ahead. I believe it should copy both from and to container? containers.podman.podman_copy is fine.
It's weird docker has only one way copy module.

@DilasserT
Copy link
Contributor

Yes, I do not see why it should not do both.

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

No branches or pull requests

3 participants