#Is there a way to export a dockerfile?

1 messages · Page 1 of 1 (latest)

gentle cedar
#

Hello, I was thinking, if there is a way to export a daggerized run to a dockerfile.

eg

dag.Client().From("alpine").WithExec([]string{"pwd"}).Sync().ExportDockerfile("Dockerfile")

Reason for this is to be able to see what is actually being run and understand the process and potentially improve the order of things for better caching. Imagine a much longer pipeline, where conditionally adding steps. Which can become hard to follow

fossil ridge
#

@gentle cedar that's not supported sorry... It wouldn't be fully accurate anyway since Dockerfiles can't express every Dagger operation.

Have you tried the web UI to visualize traces? You can press w from the terminal during a run. It's very helpful to see what happens, opportunities to improve order etc

gentle cedar
#

No worries. I guess traces might help yea. I'm mostly trying to "map" buildkit's type for cache (on the filters on GCPolicy section) with dagger operations.

I dont think I can use w in my case, I'm starting the pipelines with go run and a custom built "ci app". But webui should probably work

fossil ridge
gentle cedar
#

Oh right! It's been a while I touched this project. Had to deal with some stuff first!
Will check it out. Hopefully soon we will start using it for prod! Will be a much better output for devs to parse on CI logs. (Which is why I did it fully custom)
Markdown formatted etc 😛 QR codes for website previews (we built ~50 sites per run)