A nightly job writes reports that a second container must read. Give them a shared named volume, and clean up a volume nobody uses.
Create the volume and find where it lives on the host:
sh
docker volume create reports
docker volume inspect --format '{{.Mountpoint}}' reportsWrite a report from one container, and read it from another that mounts the same volume at /data:
sh
docker run --name writer -v reports:/reports alpine:3.20 sh -c 'echo ok > /reports/daily.txt'
docker run -d --name reader -v reports:/data alpine:3.20 sleep infinity
docker exec reader cat /data/daily.txtLook at the file from the host:
Finally, list the volumes and remove old-cache:
sh
docker volume ls
docker volume rm old-cache