#How do I export a Container created in Dagger?
1 messages · Page 1 of 1 (latest)
there's publish for pushing to a registry: https://pkg.go.dev/dagger.io/dagger#Container.Publish
@swift ingot thanks! Is there a way to get it into the daemon?
(besides pushing and pulling, I mean)
Not currently, feel free to open an issue, there's no precedent for direct interaction with docker though so I'm not sure if we'd do that
There'll be a way to export oci images to the host filesystem soon, which could be loaded into docker externally
Once we add support for running services (in a PR at the moment) one option will be to just run it directly from your pipeline
Otherwise: what @swift ingot said (which is how the CUE sdk does it too, with the docker/cli package)
I didn't know services were that close! That's actually huge for us -- one thing I hate about our current pipeline is that our dev builds and prod builds are mostly separate code paths. I don't know exactly which things can be shared, but I'd love to have good tools to experiment with that.
There is now also https://pkg.go.dev/dagger.io/dagger#Container.Export which allows you to export the container as OCI tarball which you can then load from the outside 🙂 I haven't yet found a way to get to the sha256-image-ID yet so that running docker tag on the output gets easier, though 😦 Does anyone perhaps have an idea there?
oh yeah, it would be nice if export returned that, like Publish does
@crisp axle would this help? https://docs.dagger.io/252029/load-images-local-docker-engine
(warning: it's mostly hacks and workarounds - but it works)
(For getting into a registry, it's easier as @swift ingot mentioned: just Container.Publish)
@full crater those help, but it's definitely something that would be nice to have a first-class answer for, for cases where Dagger needs to integrate with existing tools that assume things will be in the daemon