I have a local script main.py that imports another local script submain.py. When I run it in a docker I get the following error:
qsub -cwd -soft -l docker,docker_images="*docker_imagename*" -S /usr/bin/python ./main.py --arg1 value1 --arg2 value2
from submain import func
ImportError: No module named submain
My Dockerfile looks like this:
FROM ubuntu:latest
RUN apt-get -y update && apt-get -y install build-essential libxml2-dev zlib1g-dev python-dev python-pip pkg-config libffi-dev libcairo-dev
RUN pip install --upgrade pip
RUN pip install python-igraph scikit-learn numpy scipy matplotlib
CMD /usr/local/bin/igraph
How can I run my script main.py with additional script stored locally? If this not possible, how I "attach" submain.py to docker image?
COPYyour python files into the Dockerfile?docker run dockerimagename, also with the previous suggestion to add COPY directives to get the files in, and a different CMD.)