Skip to content

Commit df7d5d7

Browse files
markdryangopherbot
authored andcommitted
unix: automatically remove container created by mkall.sh
When GOOS=linux, mkall.sh creates a container to run linux/mkall.go. It does not remove this container before exiting. Therefore each time you run mkall.sh on Linux you end up with a new stopped container that must be manually deleted with docker rm. This is cumbersome as it may take several runs of mkall.sh to develop and test a patch for golang/x/sys/unix resulting in multiple containers that require manual removal. It's also a little counterintuitive as the user doesn't invoke the docker command directly so it's not obvious that manual cleanup is required after mkall.sh completes. The leftover containers aren't even that useful for debugging as they have an entrypoint set. Change-Id: I92a94ae53078f0095d3ddf1d95c4879f1bc1cb2a Reviewed-on: https://go-review.googlesource.com/c/sys/+/513335 Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Florian Lehner <lehner.florian86@gmail.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
1 parent 68a4a8e commit df7d5d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

unix/mkall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [[ "$GOOS" = "linux" ]]; then
5151
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
5252
set -e
5353
$cmd docker build --tag generate:$GOOS $GOOS
54-
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
54+
$cmd docker run --rm --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
5555
exit
5656
fi
5757

0 commit comments

Comments
 (0)