I am trying to build windows container in which execute .exe file. The code is as below.
I could confirm this python file run .exe file since result file is generated. However, when I build the windows container and run the docker container, exe file seems not executed since result file is not generated.
Can anyone tell me why this Dockerfile is failing to execute .exe file and how to solve this issue?
app.py
import subprocess
import sys
import os
import boto3
import zipfile
def main():
#os.chdir("ecs/test/dataset")
os.chdir("test/dataset")
if os.path.isfile("therb.exe"):
print("therb.exe is found")
p = subprocess.Popen("Therb.exe",shell=True)
p.wait()
stdout,stderr=p.communicate()
print('STDOUT: {}'.format(stdout))
print('STDERR: {}'.format(stderr))
print ("list directory after",os.listdir())
else:
print("therb.exe is not found")
print ("list directory after",os.listdir())
if __name__ == "__main__":
result = main()
Dockerfile
FROM python:windowsservercore-1809
COPY . /app/ecs
WORKDIR /app
RUN pip install --upgrade pip setuptools wheel
RUN pip install -r ecs/requirements.txt
ENTRYPOINT ["python","ecs/app.py"]