[gitian-builder] By default, cleanup the target after use
Summary:
After running gbuild, the VM is left running. This unnecessarily
consumes system resources if left alone.
I don't see a strong rationale for leaving the VM dangling after
running, especially since gbuild always cleans up the old VM at the start
of each execution (see line 54, where stop-target is called). By default,
the VM should be stopped. A new option has been added to override this
behavior, should it be useful in other configurations.
If this review is accepted, I'll open a PR upstream.
Test Plan:
OS_NAME=win ./contrib/teamcity/gitian.sh docker ps -a
Pre-patch, there is a container called gitian-target still running after the build.
Post-patch, there is not.
Editting gitian.sh with ./bin/gbuild --skip-cleanup, the container is once again
left to run.
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D7726