Closed MadOtis closed 4 years ago
Hi!
I unfortunately wasn't able to repro this - Tilt built your Dockerfile successfully on my machine. Is it possible your Tiltfile's docker_build
is using ignore
or only
to filter out src
? We've seen some people using those parameters unaware that they affect what goes into the docker build context.
I started from a working K8S project that does deploy and build from CLI or via a GitLab CI/CD pipeline; the goal was to learn about Tilt and see how it would help local development; so, basically, my Tiltfile really only contains mostly what the 15 minute tutorial starts you off with. However, here is my full Tiltfile:
print('My App Tiltfile')
k8s_yaml(['deploy/service-account.yaml','deploy/operator.yml'])
docker_build('app/app', 'app', dockerfile="./Dockerfile")
A few particulars, just in case they might be relevant: Docker version 19.03.8, build afacb8b MacOS Catalina 10.15.4 Tilt v0.12.10, built 2020-03-26
It's worth pointing out that if your Tiltfile has:
docker_build('app/app', 'app', dockerfile="./Dockerfile")
The second argument is the Docker context. So that corresponds to the CLI invocation:
docker build -t app/app -f Dockerfile ./app
is that what you intended? From the CLI repro step in your first comment, it sounds like you intended:
docker_build('app/app', '.')
Perhaps I need to RTFM a little more thoroughly... Yep, that was the solution. For some reason I interpreted the second argument as the actual name of the container itself and not the directory to look for the Dockerfile in. Closing this.
No worries...Tilt should also do a better job about communicating what's in the docker context instead of making people guess :)
Hi!
I unfortunately wasn't able to repro this - Tilt built your Dockerfile successfully on my machine. Is it possible your Tiltfile's
docker_build
is usingignore
oronly
to filter outsrc
? We've seen some people using those parameters unaware that they affect what goes into the docker build context.
Thanks! This was it for me. The docs make it sounds like only
are the files that can trigger the live_update
.
When trying to on-board Tilt to an existing project with a Multi-stage Docker build, Tilt seems to be unaware of the current directory, causing the Docker build to fail. The following Dockerfile works exactly as it should when used to build from CLI, script file, Gitlab pipeline, etc, but fails within Tilt:
results in (within Tilt environment)
versus via CLI: