New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Create Dockerfile from Dagger #7357
Comments
I remember i wrote it somewhere on my machine.😃 But some instructions are not supported by Dagger. |
What do you mean by this? :) |
Sorry. I mean I writing a tool like this. But it’s translate from Dockerfile to Dagger. I think we might use graphql parser to translate back somehow. |
A Dockerfile is often still necessary in certain cases, so this would be really cool. |
I'm not sure how feasible this is. This would only really be possible for the most basic of dagger pipelines, but it's kind of unclear how this might work with modules/etc. If we did decide to do this, the first step would be to remove all of our custom low-level buildkit parts, and either upstream these, or work out how to do without them. We have quite a lot of these, which allow us to do things that the buildkit runtime wouldn't normally let us do (custom sources, our own local directory loading, session manipulation to get isolation, etc). Doing the reverse seems pretty fun though, there's a dockerfile parser, we could fairly easily write little translators for those into dagger pipelines without too much fuss I think (maybe a fun hackathon project there) - maybe inspired by @wingyplus if there's source code available 🎉 |
Thanks for the context on why this is challenging - the other idea was to make a plugin (or something) for docker compose that allows you to call a dagger function instead of having to specify the Dockerfile as an input the `build` step.
Lev Lazinskiy
Head of Solutions @ dagger.io ( http://dagger.io )
e: ***@***.***
p: 415.470.2142
…On Mon, May 13, 2024 at 2:59 AM, Justin Chadwell < ***@***.*** > wrote:
I'm not sure how feasible this is. This would only really be possible for
the most basic of dagger pipelines, but it's kind of unclear how this
might work with modules/etc.
If we did decide to do this, the first step would be to remove all of our
custom low-level buildkit parts, and either upstream these, or work out
how to do without them. We have quite a lot of these, which allow us to do
things that the buildkit runtime wouldn't normally let us do (custom
sources, our own local directory loading, session manipulation to get
isolation, etc).
Doing the reverse seems pretty fun though, there's a dockerfile parser, we
could fairly easily write little translators for those into dagger
pipelines without too much fuss I think (maybe a fun hackathon project
there) - maybe inspired by @ wingyplus ( https://github.com/wingyplus ) if
there's source code available 🎉
—
Reply to this email directly, view it on GitHub (
#7357 (comment) ) , or
unsubscribe (
https://github.com/notifications/unsubscribe-auth/AB44P2EKAUYTWYEPOBYUAN3ZCCFIJAVCNFSM6AAAAABHRMZFBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBXGE2TANBSGM
).
You are receiving this because you authored the thread. Message ID: <dagger/dagger/issues/7357/2107150423
@ github. com>
|
It's something like this https://github.com/wingyplus/d2d/blob/main/main.go. But I didn't continue digging further due to my busy work. 😢 |
What are you trying to do?
Dagger is really good at reading and executing Dockerfiles, but it would be really cool if you could generate a Dockerfile from Dagger as well.
Why is this important to you?
A few users have mentioned that rewriting their Dockerfile in Dagger (which is a good thing) has some downstream consequences. Most critically it breaks existing docker-compose setups.
How are you currently working around this?
No great workaround.
The text was updated successfully, but these errors were encountered: