The 'run' file must be an executable application.
For a shell script, that means it must start with:
#!/bin/bash
Thus you should be using:
#!/bin/bash
python /opt/app-root/src/.s2i/bin/app.py
You also should not be putting your 'app.py' file in the '.s2i/bin' directory.
It should be in the root of the repo. That way it will be automatically copied
to:
/opt/app-root/src
for you.
The question is though why you are even overriding the 'run' script. You can
remove it as written, place your 'app.py' file in the root of the repo and the
Python S2I will automatically find it in the /opt/app-root/src directory of the
container and run it with Python for you.
I believe I already referred you to:
https://github.com/sclorg/s2i-python-container/tree/master/3.6
<https://github.com/sclorg/s2i-python-container/tree/master/3.6>
where the behaviour of the S2I builder image is explained.
You shouldn't usually need to override either 'assemble' or 'run' if you use
the S2I images as intended.
Graham
> On 5 Jun 2018, at 4:22 am, Brian Keyes <[email protected]> wrote:
>
>
>
> I have a script that is running fine locally on my MAC , to run this script
> on my MAC i just have to run the command "python run" ( run the the name of
> my file ) and it will run fine
>
>
> I have created a git hub repo at github.com/brikeyes/os-sample-python.git
> <http://github.com/brikeyes/os-sample-python.git> and placed this working
> python file in the required path in github (os-sample-python
> <https://github.com/brikeyes/os-sample-python>/.s2i
> <https://github.com/brikeyes/os-sample-python/tree/master/.s2i>/bin
> <https://github.com/brikeyes/os-sample-python/tree/master/.s2i/bin>)
>
> when I run this in openshift I get this error
>
>
> "/tmp/scripts/run: line 1: import: command not found "
>
> I get this also if I run it locally and do not include the word python in the
> command like ./run , so I need to let it know how to run the script by
> inserting the word " phython " right before it executes .s2i/bin/run
>
> I know I have python installed as it is in the requrements.txt file in git
> hub ,
>
>
> thanks !
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users