How do I copy some log files from container to the host while running docker build from commands under Dockerfile? As soon as the build fails the building container disappear.
One way is to after every RUN command swallow the non-zero exit code, output the logs to the STDOUT and then re-push the original exit code. But it doesn't seem to scale up, like if we want to copy a whole directory, we won't be zipping and outputting that to console :P
Is there any possible potential solution? Maybe connecting a file from host to container or mounting a directory under build process?
 
     
     
    