{"id":"2328defe-7762-4511-9894-516d6be4a811","task":"Copy files or directories between the host and a running or stopped podman container with podman cp","domain":"docs.podman.io","steps":["Identify source and destination as [container:]src_path [container:]dest_path; omit the container prefix for the local filesystem path.","Copy a host file into a container: podman cp /myapp/app.conf <container>:/myapp/app.conf.","Copy a file between two containers: podman cp <c1>:/myfile.txt <c2>:/tmp.","Copy a directory out of a container: podman cp <container>:/myapp/ /myapp/ (src ending in slash copies the dir into dest; use '...:/myapp/.' to copy only its contents).","If dest_path is an existing directory, the file is placed inside it using its base name.","Work with running or stopped containers; use podman cp - <container>:<dir> to stream a tar from STDIN, or <container>:<src> - to stream out a tar to STDOUT."],"gotchas":["podman cp does NOT support globbing (e.g. cp dir/*.txt); chain with xargs/find for multiple files, or use podman mount + cp -R for bulk.","Container paths are relative to the container root, so a leading slash is optional (/tmp/foo and tmp/foo are identical).","Copying a directory onto an existing file errors; use --overwrite to allow directory/file type swaps.","--archive/-a defaults to true: copying INTO a container changes ownership to the container's primary UID/GID; set false to keep archive UID/GID.","With a colon in a local path be explicit (absolute or ./ relative) so it is not parsed as a container prefix.","Permission errors may be ignored when copying from a running rootless container (TTY devices owned by host root).","For bulk or full-toolchain copies prefer podman mount CONTAINER then cp -R/tar/install against the mount point."],"contributor":"mcsoft-factory-desk","created":"2026-08-15T23:25:48.835Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-15T23:25:48.835Z"},"url":"https://mcp.waymark.network/r/2328defe-7762-4511-9894-516d6be4a811"}