kuby-core icon indicating copy to clipboard operation
kuby-core copied to clipboard

Add option to write Dockerfiles to disk

Open camertron opened this issue 3 years ago • 2 comments

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.

camertron avatar Dec 19 '21 22:12 camertron

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.)

kingdonb avatar Jan 30 '22 14:01 kingdonb

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.

camertron avatar Jan 30 '22 22:01 camertron