Tilt: Support for podman instead of docker

Created on 22 Nov 2019  路  9Comments  路  Source: tilt-dev/tilt

Latest version of Docker doesn't work on Fedora 31 because of missing cgroupsv2 support. Can you add support for alternative container runtimes - for example podman.

bug

Most helpful comment

we actually needed to do some fixes on the Tilt side, which will be available in the next release. I'm also going to add a bit to our custom_build guide, but for reference, here's a demo Tiltfile where i got it working:

https://github.com/windmilleng/tilt-frontend-demo/blob/nicks/buildah/Tiltfile

All 9 comments

FYI, Docker works when you boot with systemd.unified_cgroup_hierarchy=0. Still +1 from me.

Can you add support for alternative container runtimes - for example podman.

Just to be sure I understand, is the issue with the container runtime or the image builder? (it's common to conflate the two since they often come as one package)

For the image builder, tilt supports non-docker image builders via custom_build.

For the container runtime, I believe as long as you're not using restart_container with live_update, the container runtime does not matter to Tilt. (and if you want to use restart_container with a non-docker runtime, there's rerun-process-wrapper as a workaround.

I think this is about image building, so the relevant tool is buildah.

I still have a lot of confusion around registries, but custom_build does not seem to be a full replacement because Tilt still assumes the result is an image stored in Docker. You could do disable_push=True, but it seems like Tilt has some mechanisms built in to override a remote registry with a in-cluster registry (or does it?), so doing a push via buildah would break that.

Besides, I think there's still some value in supporting buildah natively. When you work in a team and people are using different platforms, not everyone will be using the same container builder/runtime. podman/buildah do not require a daemon or even root access, that's why they're seeing more and more adoption.

let me poke at this a bit and write docs on how to do it.

ideally, i'd want custom_build to be powerful enough that you could implement docker_build as just a thin wrapper around custom_build. And then there'd be a bunch of off-the-shelf Tiltfile functions for how to use custom builds that you could load() or copy-and-paste.

custom_build should be smart enough to handle in-cluster registries correctly but i'll check that too

@nicks thanks! amazing job! I'm going to test it now.

we actually needed to do some fixes on the Tilt side, which will be available in the next release. I'm also going to add a bit to our custom_build guide, but for reference, here's a demo Tiltfile where i got it working:

https://github.com/windmilleng/tilt-frontend-demo/blob/nicks/buildah/Tiltfile

can't test as I can't build binary :-(

# make all
....
FAIL
FAIL    github.com/windmilleng/tilt/internal/tiltfile   13.045s
ok      github.com/windmilleng/tilt/internal/tiltfile/analytics (cached)
ok      github.com/windmilleng/tilt/internal/tiltfile/dockerprune   (cached)
ok      github.com/windmilleng/tilt/internal/tiltfile/flags (cached)
ok      github.com/windmilleng/tilt/internal/tiltfile/git   (cached)
ok      github.com/windmilleng/tilt/internal/tiltfile/include   (cached)
?       github.com/windmilleng/tilt/internal/tiltfile/io    [no test files]
ok      github.com/windmilleng/tilt/internal/tiltfile/k8scontext    (cached)
ok      github.com/windmilleng/tilt/internal/tiltfile/os    (cached)
ok      github.com/windmilleng/tilt/internal/tiltfile/starkit   (cached)
?       github.com/windmilleng/tilt/internal/tiltfile/value [no test files]
ok      github.com/windmilleng/tilt/internal/tiltfile/version   (cached)
ok      github.com/windmilleng/tilt/internal/token  (cached)
ok      github.com/windmilleng/tilt/internal/tracer (cached)
ok      github.com/windmilleng/tilt/internal/watch  (cached)
ok      github.com/windmilleng/tilt/internal/yaml   (cached)
ok      github.com/windmilleng/tilt/pkg/assets  (cached)
ok      github.com/windmilleng/tilt/pkg/logger  (cached)
ok      github.com/windmilleng/tilt/pkg/model   (cached)
?       github.com/windmilleng/tilt/pkg/webview [no test files]
?       github.com/windmilleng/tilt/tools/devlog    [no test files]
?       github.com/windmilleng/tilt/web [no test files]
FAIL
make: *** [Makefile:58: test-go] Error 1

Will wait until next release.

OK, v0.10.22 should have a new argument to custom_build called skips_local_docker=True that skips the image check so you can use buildah. I've updated the branch with more details:
https://github.com/windmilleng/tilt-frontend-demo/blob/nicks/buildah/Tiltfile

Added some documentation to the custom_build guide on how to use buildah:
https://docs.tilt.dev/custom_build.html

Was this page helpful?
0 / 5 - 0 ratings