This works
$ dagger -c 'my-container | export-image myimage:mytag'
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
myimage mytag 2f711418bc87 39 minutes ago 109MB
But I want to run something like
$ dagger -c 'export-my-container-image myimage:mytag'
When I do I get the error:
! client has no supported api for loading image
My dagger module looks like this:
func (h *Headway) MyContainer(ctx context.Context) *dagger.Container {
return dag.Container().From("debian:bookworm-slim")
}
func (h *Headway) ExportMyContainerImage(ctx context.Context, imageNameAndTag string) error {
container := h.MyContainer(ctx)
return container.ExportImage(ctx, imageNameAndTag)
}
The real reason I want to do this is that I have a bunch of services which need their containers built, so I'd like to do them all as part of a single function call, like:
$ dagger -c 'build-all-images my-release-tag'
The output of that would be the 10 or so containers, all with their own names and tagged with my-release-tag.
I'm aware there are other methods for publishing to a remote registry - but I want to export to my local docker daemon (just like what happens with | export-image) so that I can test my stack locally using docker compose.
How do I get around this error?
Note: I'm on macos using orbstack