Skip to content

Commit a791616

Browse files
authored
Merge pull request #473 from doringeman/container-create-empty-config
fix(context): pass an empty config to avoid panic
2 parents 4044682 + 3fe82e1 commit a791616

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/cli/desktop/context.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/containerd/errdefs"
1515
"github.com/docker/cli/cli/command"
1616
"github.com/docker/cli/cli/context/docker"
17+
"github.com/docker/docker/api/types/container"
1718
clientpkg "github.com/docker/docker/client"
1819
"github.com/docker/model-runner/cmd/cli/pkg/standalone"
1920
"github.com/docker/model-runner/cmd/cli/pkg/types"
@@ -163,7 +164,7 @@ func wakeUpCloudIfIdle(ctx context.Context, cli *command.DockerCli) error {
163164
// The call is expected to fail with a client error due to nil arguments, but it triggers
164165
// Docker Cloud to wake up from idle. Only return unexpected failures (network issues,
165166
// server errors) so they're logged as warnings.
166-
_, err = dockerClient.ContainerCreate(ctx, nil, nil, nil, nil, "")
167+
_, err = dockerClient.ContainerCreate(ctx, &container.Config{}, nil, nil, nil, "")
167168
if err != nil && !errdefs.IsInvalidArgument(err) {
168169
return fmt.Errorf("failed to wake up Docker Cloud: %w", err)
169170
}

0 commit comments

Comments
 (0)