From bb9742f6b488183087ef63c3fa0e4e6533402d1c Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Thu, 7 Nov 2024 13:41:47 +0200 Subject: [PATCH] fix: autoremove container in examples When running the examples they leave unnecessary containers hanging around. Add AutoRemove: true, to automatically remove them. --- examples/emulator_runner.go | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/emulator_runner.go b/examples/emulator_runner.go index b9be22f1..71cf6643 100644 --- a/examples/emulator_runner.go +++ b/examples/emulator_runner.go @@ -93,6 +93,7 @@ func startEmulator() error { Image: "gcr.io/cloud-spanner-emulator/emulator", ExposedPorts: nat.PortSet{"9010": {}}, }, &container.HostConfig{ + AutoRemove: true, PortBindings: map[nat.Port][]nat.PortBinding{"9010": {{HostIP: "0.0.0.0", HostPort: "9010"}}}, }, nil, nil, "") if err != nil {