0
votes

I have a python project that's working fine. This is its setup.py:

from setuptools import setup

setup(
    name='project',
    version='0.4.2',
    packages=['project', 'project.models', 'project.modules', 'project.transforms'],
    url='http://12.3.4.100/team/project',
    license='',
    author='author1, author2',
    author_email='[email protected], [email protected]',
    description='Some text',
    scripts=[
        'scripts/do_something'
    ],
    install_requires=[
        'dependency1 >= 0.3.5',
        'torch >= 1.0.0',
        'dependency3 == 0.1.2',
        'numpy >= 1.15.0'
    ],
)

Now I'm dockerizing this project. So I've created a Dockerfile:

FROM pytorch/pytorch:1.5.1-cuda10.1-cudnn7-runtime

COPY project /project
COPY scripts /scripts
COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt --trusted-host 12.3.4.167 --extra-index-url http://12.3.4.167:8081/repository/team-python/simple

ENTRYPOINT ["scripts/do_something"]

But when I run the image I'm getting an error:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: "scripts/do_something": stat scripts/do_something: no such file or directory": unknown

I've been trying to google it for hours but still haven't figured out what I'm missing.

Please let me know if you need any more information.

1
Does the file scripts/do_something exist? Is it executable? Did you try referencing it with the absolute path in ENTRYPOINT? - Frank Schmitt
What does the scripts/do_something contain? Is it a python file or a bash script? Have you included the extension also or just "do_something"? - maetulj
@FrankSchmitt yes it exists. It's a python file. I'm referencing it with a relative path. - Alon
@maetulj it's a python file without the .py extension. - Alon
is the host OS (from where you are running docker build) windows or linux-based? - kerasbaz

1 Answers

0
votes

There are several potential issues here. Your current issue is the disconnect between /scripts and scripts/do_something -- one assumes a full path from root, the other is a relative path. Pick one and use it in both places.

You may also have permissions issues if your docker host is windows-based instead of linux (since you aren't calling python against the file and have not chmodded it).