This is what I tried:
Dockerfile:
ENTRYPOINT go test ./tests -v .>/outputs/report.txt
Command line:
docker run test -v /outputs:/outputs
I expect that the newly generated report.txt will be available in the host in the same directory. What am I missing here?
I think that you almost made it.
Try to map the volume before image name.
Instead:
docker run test -v /outputs:/outputsUse:
docker run -v /outputs:/outputs testThis command will bind your local
/outputswith the/outputsin the container. And remember, all commands after image name will pass acommandto the container.For more information see: Docker run command docs and Docker volume docs