I think the parts “on docker run completion” and “happen from within the container” complicate things. What about just making a specific folder on your host machine always available to the container(s)? Then it’s up to your container(s) when to use that.
That is what “bind mounts” are for, but it’s not something that can be setup from within the container, unless you grant it specific rights. It’s much easier to configure it when starting the container; see Use bind mounts in the Getting Started.
If the JSON output is only needed by other containers, not on the host machine directly, then Docker “named volumes” can also be shared across containers. See Persist the DB in the Getting Started.