Within msys2, anytime I try to execute a docker run [image] [cmd]
command such that I'm trying to run in the docker container overwrites the command specified in the Dockerfile, it looks for the command locally and fails if it doesn't exist.
For example, my organization has a docker image where the python executable is at /usr/src/venv/bin/python
and python is not in $PATH
. That is not where my local python is installed and when I try to run docker run myimage /usr/src/venv/bin/python test.py
I get this error: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"C:/msys64/usr/src/venv/bin/python\": stat C:/msys64/usr/src/venv/bin/python: no such file or directory"
This image is not a windows image and so it shouldn't be looking at C:
at all so I must conclude it's looking for that command locally instead of within the container.
Note: The docker I'm running is Docker for windows added to my $PATH
within msys2.
$ which docker
/c/Program Files/Docker/Docker/Resources/bin/docker.exe
One workaround I've used is to create a new Dockerfile that just has a line to say to use the image I want and another that is the command I want. Then I can run docker run some-image
without specifying a command and it works.
Is there some way I can fix this problem within msys2 without the annoying workaround described above?