#Is it possible to build docker images inside of the container?
1 messages ยท Page 1 of 1 (latest)
Hi,
https://pkg.go.dev/dagger.io/dagger#Container.Build enables you to build images from Dockerfiles
I have a slightly more complex scenarios which I want to keep same as much as possible.
First one is we're building docker images using goreleaser with couple of services together.
I guess services is not that relevant. Let me rephrase my original question. Can I mount docker.socket to dagger container? and if it's possible, How?
My bad, dagger go sdk doesn't seem to be able to mount sockets, for now: https://github.com/dagger/dagger/issues/3465. At least, we still do not expose an API for now. Can you please make an issue out of it ? With your use-case. It will help prioritizing the work ๐
PS: thanks for the rephrasing ๐
No worries, thank you for quick response. Sure I'll create an issue
This is similar to the buildpack use case
Basically there are 3 possible approaches:
1: connect to an external docker engine: by unix socket as discussed here (not yet implemented but coming soon) or by ssh
2: fork goreleaser to call dagger API instead of docker API. This is the most robust solution long term but obviously there is non-trivial work initially
- implement a proxy that translates docker engine API calls to dagger engine API calls. This should not be too much work butโฆ still not trivial
Hope this helps
cc @thorny ginkgo @restive fern @crude plover ๐ (not urgent)
Other than this goreleaser workflow in our CI or Local environment we need to heavily rely on docker like KinD clusters. I guess most feasible approach is connecting external docker engine as you mentioned option 1.
It's great to hear it'll be coming soon.
Please let me know if you need extra contributor for adding this feature faster ๐
@hearty heron one thing that would be super helpful would be filing an issue on github, explaining the feature you need and why. It doesnโt have to be long or complete. itโs easier to prioritize a feature when everyone sees that actual users want it ๐
@midnight sierra sure definitely will do it