docker from container to host file code example
Example 1: copy file from docker container to host
docker cp <containerId>:/file/path/within/container /host/path/target
Example 2: run host command from docker container
docker run --rm -v $(pwd)/mybashscript.sh:/mybashscript.sh ubuntu bash /mybashscript.sh