kuby-core
kuby-core copied to clipboard
Add option to write Dockerfiles to disk
Whether you're using git-ops, want to version your Dockerfiles in source control, or just want to store them in a file, Kuby should support emitting them via the CLI. Perhaps something like kuby dockerfiles -o /path/to/output_dir.
I made up solutions for this issue together with #79 for my own use, not sure I'm ready to upstream anything but I'm thinking about it now. 👍
https://github.com/kingdonb/kuby_test/blob/42e0871fb886a13637232d060fc2efa70938512f/builder.sh#L3-L4
It turned out to be important to separate the dockerfiles for me. So you'll see in the script linked above, I call for the main dockerfile and the assets dockerfile separately. Because of the way this works, there is a new codepath that executes when building the assets-only file, (and it was a while ago already that I did this, but I remember finding out it can fail separately.)
Nice, that's great :) The --only option does make this easier now. Still would be nice to have a CLI option for this, although Kuby would have to impose some sort of file naming convention like you've done with the .assets suffix.