buildah
buildah copied to clipboard
Feature Request: "record" a Dockerfile by using sequential buildah run/copy/config etc commands
When you author a long Dockerfile/Containerfile, it is increasingly likely that you make mistakes or receive errors from installation tooling during the integration process. Debugging these files can be time consuming since the build must pull GB of data sequentially from various sources.
The proposal is to have a command like buildah record start. Every subsequent Dockerfile-compatible command (run, copy, config) run through buildah would be recorded. After you're done, you could save the log to a would-be Dockerfile for further amendment, re-ordering, documentation, and so on. So there would be a buildah record save <filename> and a buildah record abort.
Obviously this wouldn't capture the details of direct modification of the rootfs that are available via the mount command. But for the purposes of debugging Containerfile creation, this feature would be of great benefit.
@nalind WDYT?
I guess we could launch a shell that would record all buildah commands and then generate a Containerfile, when the shell exits.
I was thinking that instead of a shell or repl, buildah would simply check for the existence of a private log file when it runs. If the command is a Dockerfile-compatible command, if it is successful, and if the logfile exists, append the command to that file with the appropriate syntax. The buildah record stop and buildah record abort commands would simply delete the log file and/or copy it to some target path specified by the user.
The best way to get this implemented would be to open a PR. :^)
The issue with a log file somewhere, is that you can only do one at a time. Which might be ok. A second buildah record start would fail.
@mjml Have you considered contributing a PR for this?
I would like to Dan but at the moment I am swamped. I will revisit my container adventures mid to late fall and may have some more time then.
@mjml did you ever do anything with this?
I haven't implemented it, but it doesn't seem like a very difficult feature. I'm not familiar enough with buildah internals to really judge and since I still have a lot going on, I haven't had the chance to revisit.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
@flouthoc WDYT?
A friendly reminder that this issue had no activity for 30 days.