Using Tilt from within a container.
Tilt is great, but it doesn't currently run on Windows. But can we run it in a container on Docker Desktop for Windows instead?
First build a Docker image for Tilt using the Dockerfile in this Gist.
$ docker build -t garethr/tilt .
And then run tilt up
. Note that we mount the Docker socket and our Kubernetes configuration.
docker run --rm --net=host -it -v ~/.kube/config:/root/.kube/config -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/code garethr/tilt up backend
This mainly works! Though a few issues arose that are worth looking into when time permits:
--watch
doesn't work across the file mounttilt demo
crashes- on Docker Desktop the kubernetes config file will point to localhost. For this to work from within the container you currently have to change the server to
host.docker.internal