Closed psychemedia closed 3 years ago
This is already implemented. If you run the ou-container-builder with the --no-clean
flag then the generated Dockerfile (and all other generated files) are not removed at the end of the build. If you run it with --no-build
then everything will be generated, but no Docker build will be undertaken and no cleaning takes place either.
Ah, ok... (I should have checked the code;-)
Do you want to me to chip things in to docs, or would you prefer to write the docs yourself (in which case I could pop suggested D0 versions into issues).
Just stick it in the docs and make a pull request.
For archiving purposes, as well as for simple testing / debugging / archiving purposes, it might be useful to save the generated Dockerfile as a matter of course to a local file.
(It might also be useful to bake it into the image at a conventional location as self-documentation which is a practice I have seen elsewhere.)
Alternatively, save the Dockerfile on request, eg as a result of making a
ou-container-builder --dry-run
request.Given that you create files for copying into the container, the
Dockerfile
on its own would not be sufficient to rebuild the image. So maybe something like--dry-run
to create the Dockerfile and--dry-run-all
or--dry-run-standalone
to eg copy all created files from the temporary build directory to a local directory.If this were saved locally as a default, then it would also make sense to allow a switch to not keep a copy of the build files (
--clean
, maybe?).