How do you copy files in and out of containers and handle large exports?
BeginnerProductionOperations, Rootless & Podman
Answer
docker cp web:/var/log/app.log ./app.log
docker cp ./config.yml web:/etc/app/config.yml
docker exec db pg_dump -U app app | gzip > backup.sql.gz
docker cp works on stopped containers too. For big or frequent transfers use volumes or object storage rather than cp.
More on Operations, Rootless & Podman
How do you set up rootless Docker on Ubuntu?IntermediateHow do rootless containers handle privileged ports and networking?AdvancedWhat is Podman Quadlet?AdvancedCan Podman run Docker Compose files?IntermediateWhat is a Podman pod?IntermediateHow do you remove all Docker containers, images and volumes safely in a dev environment?Beginner