Running multiple python main files off Docker image

I have created a Docker image with dockerfile where the Entrypoint is as follows:

ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "myproject", "python", "./myprojectmain.py", "--config", "./config.py"]

When I run I use the command:

docker run myproject

all is fine it seems. However I have a secondary .py file in the root of the project called setup.py. The purpose of this file is to update some of the config and json files after getting some input from the user.

Is there a way to run this secondary file (setup.py) or do I need to create a whole new image (which seems ridiculous).

Thanks

Answer

Well… if you got an image, you don’t have to use entrypoint… just run your scripts like this:

docker run image "python /some/path/myscript.py"

or

docker run image /bin/bash -c "cd /some/path && python myscript.py"

or with entry point

RUN ./myprojectmain.py --config ./config.py
RUN ./myproject2main.py --config ./config.py
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "myproject", "python"]