mmh352 / ou-container-builder

0 stars 2 forks source link

Create a saved copy of the Dockerfile #8

Closed psychemedia closed 3 years ago

psychemedia commented 3 years ago

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

mmh352 commented 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.

psychemedia commented 3 years ago

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

mmh352 commented 3 years ago

Just stick it in the docs and make a pull request.