Docker issue
PetrovskyM opened this issue · 3 comments
Hello, I am trying to run benchmarks on my computer and I've had some issues. I tried to follow steps u have listed in "Using Docker". I built an image using docker build docker/ -t benchmarks
, then I tried to run the image using
docker run -it --rm -v cd:/src benchmarks json
and I had the following error ** No such file or directory @ dir_s_chdir - /src/json **.
Command docker run -it --rm -v cd:/src benchmarks versions
works.
Is this because I am using Windows? Do you have any advice that could help me run it?
I am learning with docker and I would apriciate any help. Thank you.
I am currently using:
Windows 10
WSL2
I never tried wsl2. On windows, i use virtualbox with linux, and run docker there. If you cpu support virtualization, you will get the same performance if you just install pure linux.
It's a known problem with the Docker's bind-mounted directories in WSL: https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly#ensure-volume-mounts-work
Essentially, you need to either change WSL configuration, or instead $(pwd)
(that returns /mnt/c/Users/...
) manually specify the path like /c/Users/...
(by removing /mnt
).
Also, I'd like to note that it's easier to use shell
command if you have any issues and invoke tests from within the shell. For example, if you have sources located as C:\Users\user\Documents\benchmarks
, instead of docker run -it --rm -v /c/Users/user/Documents/benchmarks:/src benchmarks json
you could use:
docker run -it --rm -v /c/Users/user/Documents/benchmarks:/src benchmarks shell
cd json
make run
(or run individual tests. e.g. make run[target/json_cr]
, please see Makefiles for the targets).
Please let me know if you have any other issues, otherwise please close the ticket. WSL hasn't been tested, but majority of the cases should work.
Thank you