0

So I have a script, a.py, on my local machine which will only work on Windows operating system since it uses certain packages that only work on Windows.

I have another script, b.py. I am using the below code to execute a.py from b.py and get the output.

command = [sys.executable, 'a.py', '-i', some_argument]
process = subprocess.check_output(command).decode()

The problem is b.py is in a docker container and a.py is in the host machine. I'm running a Linux container since Windows container was having a lot of other problems.

I have thought of using Volumes on docker. But I'm assuming, by using volumes, a new directory is made in the Docker's storage directory and it will try to run a.py in the Linux container (which wont work because script only works on Windows).

So is there a way for b.py (in container) to execute a.py (in host machine)?

Usman
  • 1,983
  • 15
  • 28
Ashyam
  • 666
  • 6
  • 13
  • Possible duplicate of [How to run shell script on host from docker container?](https://stackoverflow.com/questions/32163955/how-to-run-shell-script-on-host-from-docker-container) – David Maze Mar 11 '19 at 14:15
  • The short answer is “no, Docker is explicitly designed so you can’t do that”, though the answers to that question provide several specific-case workarounds. – David Maze Mar 11 '19 at 14:17

0 Answers0