Open himat opened 3 years ago
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.
Yes, it's possible, but I'm not sure when I will be able to have a look.
Not critical actually, I did what you said of putting the dockerfile in the root of the project. Thanks!
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 wasdocker 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 todocker 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.