You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use spotty for the first time but I ran into an error after running spotty start and it tried to build my docker container:
Step 2/5 : COPY requirements.txt requirements.txt
COPY failed: file not found in build context or excluded by .dockerignore: stat requirements.txt: file does not exist
I saw in the docs that Note: Spotty uses the directory with the Dockerfile as its build context.
So this seems like why I ran into this issue since the requirements.txt file is not present in the docker context.
And indeed, the command that spotty ran was docker build -t spotty-model-server-model-server-inst-default:1616462585 -f /mnt/model-server-model-server-inst-workspace/project/docker/models.Dockerfile /mnt/ai-writer-model-server-ai-writer-model-server-inst-workspace/project/docker
whereas when I build my dockerfile locally, the last argument (the context) I would give to docker build is my root directory (/project), not /project/docker.
So is there a way to get around this, or does using spotty mean that I need to keep my dockerfile in my root directory? Or is there something I'm doing wrong.
The text was updated successfully, but these errors were encountered:
So is there a way to get around this, or does using spotty mean that I need to keep my dockerfile in my root directory? Or is there something I'm doing wrong.`
Yes, you either should put the Dockerfile into the root directory of your project or copy the requirements.txt file inside the docker/ directory. In the first case, use a .dockerignore file to ignore potentially heavy directories that may slow down the building.
Would it be possible to add a way to specify a root build context?
My project has multiple components/servers each of which has their own dockerfile, which is why I put them all in a docker/ dir in the root of my project.
So putting all the dockerfiles in the root isn't that pleasant, nor would copying the requirements.txt into that folder manually make much sense.
I'm trying to use spotty for the first time but I ran into an error after running
spotty start
and it tried to build my docker container:My directory structure
Here's my dockerfile:
docker/models.Dockerfile
Here's my spotty config:
spotty.yaml
I saw in the docs that
Note: Spotty uses the directory with the Dockerfile as its build context
.So this seems like why I ran into this issue since the requirements.txt file is not present in the docker context.
And indeed, the command that spotty ran was
docker build -t spotty-model-server-model-server-inst-default:1616462585 -f /mnt/model-server-model-server-inst-workspace/project/docker/models.Dockerfile /mnt/ai-writer-model-server-ai-writer-model-server-inst-workspace/project/docker
whereas when I build my dockerfile locally, the last argument (the context) I would give to
docker build
is my root directory (/project), not /project/docker.So is there a way to get around this, or does using spotty mean that I need to keep my dockerfile in my root directory? Or is there something I'm doing wrong.
The text was updated successfully, but these errors were encountered: