Skip to content

Commit

Permalink
cmd/docker: instance the main context in main()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thaJeztah committed Jan 29, 2024
1 parent 3865da2 commit 82ed174
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/docker/docker.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"fmt"
"net"
"os"
Expand All @@ -25,7 +26,9 @@ import (
)

func main() {
dockerCli, err := command.NewDockerCli()
ctx := context.Background()

dockerCli, err := command.NewDockerCli(command.WithBaseContext(ctx))
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down

0 comments on commit 82ed174

Please sign in to comment.