#How do I export a Container created in Dagger?

1 messages · Page 1 of 1 (latest)

crisp axle
#

Either to the local Docker daemon or to a registry. I've seen examples for writing out to the filesystem, but not for this yet

swift ingot
crisp axle
#

@swift ingot thanks! Is there a way to get it into the daemon?

#

(besides pushing and pulling, I mean)

swift ingot
#

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

full crater
#

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)

crisp axle
#

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.

astral shadow
#

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?

swift ingot
#

oh yeah, it would be nice if export returned that, like Publish does

full crater
#

(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)

crisp axle
#

@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