I built an AWS Batch compute environment. I want to run a python script in jobs. Here is the docker file I'm using :
FROM python:slim
RUN apt-get update
RUN pip install boto3 matplotlib awscli
COPY runscript.py /
ENTRYPOINT ["/bin/bash"]
The command in my task definition is :
python /runscript.py
When I submit a job in AWS console I get this error in CloudWatch:
/usr/local/bin/python: /usr/local/bin/python: cannot execute binary file
And the job gets the status FAILED.
What is going wrong? I run the container locally and I can launch the script without any errors.
PATHis not correctly set, then you may insert a shebang to inform the interpreter where to find the binary. Your local python probably has a different location than inside the container. - samthegoldenpythonbinary explicitly, the shebang line is ignored. - Konrad Rudolph