How can I build and use a docker image with a buildpack that simply runs a script with arguments?

Viewed 15

I've been experimenting with using pack to build a docker image. I'm quite happy with using a Dockerfile if that is the better approach.

I have a single python script that uses click to parse arguments. In a Dockerfile, I'd specify as the ENTRYPOINT something like ["python", "myscript.py"] and then I could run:

docker run MYCONTAINER myarg1 myarg2

and replace my script with the docker run.

I am attempting to get the same functionality using buildpacks and a Procfile. Here is what I have, roughly, in the profile:

web: python myscript.py

However, when I try running the resulting successfully built image using docker run (eg., docker run MYCONTAINER myarg1 myarg2), I get errors like:

python myscript.py: python myscript.py: command not found

Running the same docker run without the arguments works as expected and prints the help for my command-line script and exits.

What am I missing? My google-foo has failed me...

0 Answers
Related