#Is there any way to run commands against
1 messages · Page 1 of 1 (latest)
I am not talking about connecting to an exposed port, but rather using a CLI in the Service container that requires the entrypoint to have executed and the Service to be healthy.
I don't think this is possible at the moment, but can you share more about your concrete use case?
Starting a k3s I would like to run some ctr commands to preload container images. It requires k3s to be running, so I cannot do it before that. I know of the Docker registry workaround but would like to avoid that, especially since that makes it a bit hard to dynamically load images and keep tags from the image manifest.
Thanks! I agree this would be useful, right now as soon as something becomes a service it terminates any further chaining.
I am wondering if as a workaround for now we could hack the entrypoint to do something after the service starts
I think this may work for a one-off "start the service and do X" -- still does not support advanced things like interacting with the service container down the line
Extending the entrypoint is what I'd do. Similarly how other official images like MySQL and Postgres do it to run init SQL scripts, we could add something to the k3s module so it pre-loads images if they're present
This would require either a change in the image, or overriding the entrypoint in Dagger, right?
Either way, not a very general way of handling this problem as it will depend on the concrete container.
Yeah I am referring to overriding the entrypoint - It would be something like
fromI("image:tag")
.withEntryPoint()
for an existing image or one that you are building
this problem as it will depend on the concrete container.
Can you clarify what you mean by concrete container here?
We are also struggling to use dagger for I think a very similar use case right now.
We'd like to let developers start one or more long running services in dagger, including kubernetes, exposed via local ports, but also be able to interact with those running services via other invocations of dagger call over days/weeks/months.
You can achieve this today with host-to-pipeline connectivity