tilt-extensions icon indicating copy to clipboard operation
tilt-extensions copied to clipboard

Compose with nerdctl ?

Open luizhpriotto opened this issue 1 year ago • 4 comments

How can I use the nerdctl extension with "docker-compose"?

Something like:

load('ext://nerdctl', 'nerdctl_build')
docker_compose('docker-compose.yml')
nerdctl_build('testimage', context='.', dockerfile='Dockerfile',
  live_update = [
    sync('.', '/var/www/html')
  ])

Thanks,

luizhpriotto avatar Apr 19 '24 23:04 luizhpriotto

i haven't tried it, but i don't see any reason why it wouldn't work if you have nerdctl compose symlinked correctly as docker compose. what happened when you ran that tiltfile? what did you expect to happen?

nicks avatar May 02 '24 13:05 nicks

I've experimented with using nerdctl as a Docker replacement, and simply symlinking docker to nerdctl isn't sufficient. I created a symlinked wrapper for docker-compose that uses nerdctl compose and set up a proxy for the Docker socket since Tilt uses the REST API for logging. I've put together a working solution in this repository: https://github.com/ThomasGavaix/tilt-nerdctl What are your thoughts on adding native nerdctl client support to Tilt, alongside the existing Docker and Kubernetes integrations?

ThomasGavaix avatar Jul 10 '25 11:07 ThomasGavaix

@ThomasGavaix a lot depends on the overhead of implementation. for example, there are already a lot of projects that implement docker socket compatibility over different container runtimes, having a custom nerdctl docker socket shim in tilt would be pretty high maintenance overhead.

nicks avatar Jul 10 '25 13:07 nicks

I've switched from Docker to containerd as my local container runtime (running containers directly without Kubernetes). I'd like to continue using Tilt for development. What's the current best approach for integrating Tilt with containerd ?

ThomasGavaix avatar Jul 10 '25 14:07 ThomasGavaix