Skip to content

podman cpΒ #571

@avnav0

Description

@avnav0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions