Skip to content

Commit c3dfbd5

Browse files
committed
cmd/docker: instance the main context in main()
Explicitly create the context and set it on the CLI, instead of depending on NewDockerCli() to instance a default context. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 1443014 commit c3dfbd5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmd/docker/docker.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"fmt"
56
"net"
67
"os"
@@ -25,7 +26,9 @@ import (
2526
)
2627

2728
func main() {
28-
dockerCli, err := command.NewDockerCli()
29+
ctx := context.Background()
30+
31+
dockerCli, err := command.NewDockerCli(command.WithBaseContext(ctx))
2932
if err != nil {
3033
fmt.Fprintln(os.Stderr, err)
3134
os.Exit(1)

0 commit comments

Comments
 (0)