Jan 9, 2021
My current solution of access the file from both Docker container and host machine (Mac) is to use Docker-compose file. Instead of setting volume in the Dockerfile or by docker command, I put the volume in the docker-compose in the same folder with the docker files.
Here is an extreme simple version:
services:
my_service:
build: .
entrypoint: run_scripts
volumes:
- ./output:/home/run_user/output:rw
The container can put file in its /home/run_user/output folder and it shows on the host machine ./output folder.
I might share all the detail about this in another story :)