Skip to content

Commit 2dde672

Browse files
committed
feat: update deps
1 parent 72f5e20 commit 2dde672

File tree

8 files changed

+78
-2666
lines changed

8 files changed

+78
-2666
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mv docker-debug /usr/local/bin
104104
docker-debug uses nicolaka/netshoot as the default image to run debug container.
105105
You can override the default image with cli flag, or even better, with config file ~/.docker-debug/config.toml
106106
``` toml
107-
version = "0.7.4"
107+
version = "0.7.5"
108108
image = "nicolaka/netshoot:latest"
109109
mount_dir = "/mnt/container"
110110
timeout = 10000000000

go.mod

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,44 @@
11
module github.com/zeromake/docker-debug
22

3-
go 1.12
3+
go 1.21
4+
5+
toolchain go1.21.1
46

57
require (
6-
github.com/BurntSushi/toml v1.1.0
7-
github.com/Microsoft/go-winio v0.5.2 // indirect
8+
github.com/BurntSushi/toml v1.4.0
89
github.com/blang/semver v3.5.1+incompatible
10+
github.com/docker/docker v27.1.1+incompatible
11+
github.com/moby/term v0.5.0
12+
github.com/pkg/errors v0.9.1
13+
github.com/sirupsen/logrus v1.9.3
14+
github.com/spf13/cobra v1.8.1
15+
)
16+
17+
require (
18+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
19+
github.com/Microsoft/go-winio v0.6.2 // indirect
920
github.com/containerd/log v0.1.0 // indirect
1021
github.com/distribution/reference v0.6.0 // indirect
11-
github.com/docker/docker v26.1.5+incompatible
12-
github.com/docker/go-connections v0.4.0 // indirect
13-
github.com/docker/go-units v0.4.0 // indirect
22+
github.com/docker/go-connections v0.5.0 // indirect
23+
github.com/docker/go-units v0.5.0 // indirect
24+
github.com/felixge/httpsnoop v1.0.4 // indirect
25+
github.com/go-logr/logr v1.4.2 // indirect
26+
github.com/go-logr/stdr v1.2.2 // indirect
1427
github.com/gogo/protobuf v1.3.2 // indirect
28+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1529
github.com/moby/docker-image-spec v1.3.1 // indirect
16-
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6
1730
github.com/morikuni/aec v1.0.0 // indirect
18-
github.com/pkg/errors v0.9.1
19-
github.com/sirupsen/logrus v1.9.3
20-
github.com/spf13/cobra v1.5.0
31+
github.com/opencontainers/go-digest v1.0.0 // indirect
32+
github.com/opencontainers/image-spec v1.1.0 // indirect
33+
github.com/spf13/pflag v1.0.5 // indirect
2134
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
35+
go.opentelemetry.io/otel v1.28.0 // indirect
2236
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
37+
go.opentelemetry.io/otel/metric v1.28.0 // indirect
38+
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
39+
go.opentelemetry.io/otel/trace v1.28.0 // indirect
40+
golang.org/x/net v0.28.0 // indirect
41+
golang.org/x/sys v0.24.0 // indirect
42+
golang.org/x/time v0.5.0 // indirect
43+
gotest.tools/v3 v3.5.1 // indirect
2344
)

go.sum

Lines changed: 29 additions & 2641 deletions
Large diffs are not rendered by default.

internal/command/cli.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"strings"
99
"time"
1010

11+
dockerImage "github.com/docker/docker/api/types/image"
12+
1113
"github.com/docker/docker/api/types"
1214
"github.com/docker/docker/api/types/container"
1315
"github.com/docker/docker/api/types/filters"
@@ -202,7 +204,7 @@ func (cli *DebugCli) PullImage(image string) error {
202204

203205
ctx, cancel := context.WithCancel(cli.ctx)
204206
defer cancel()
205-
responseBody, err := cli.client.ImagePull(ctx, imageName, types.ImagePullOptions{})
207+
responseBody, err := cli.client.ImagePull(ctx, imageName, dockerImage.PullOptions{})
206208
if err != nil {
207209
return errors.WithStack(err)
208210
}
@@ -216,12 +218,12 @@ func (cli *DebugCli) PullImage(image string) error {
216218
}
217219

218220
// FindImage find image
219-
func (cli *DebugCli) FindImage(image string) ([]types.ImageSummary, error) {
221+
func (cli *DebugCli) FindImage(image string) ([]dockerImage.Summary, error) {
220222
args := filters.NewArgs()
221223
args.Add("reference", image)
222224
ctx, cancel := cli.withContent(cli.config.Timeout)
223225
defer cancel()
224-
return cli.client.ImageList(ctx, types.ImageListOptions{
226+
return cli.client.ImageList(ctx, dockerImage.ListOptions{
225227
Filters: args,
226228
})
227229
}
@@ -362,7 +364,7 @@ func (cli *DebugCli) CreateContainer(attachContainer string, options execOptions
362364
err = cli.client.ContainerStart(
363365
ctx,
364366
body.ID,
365-
types.ContainerStartOptions{},
367+
container.StartOptions{},
366368
)
367369
cancel()
368370
return body.ID, errors.WithStack(err)
@@ -372,11 +374,11 @@ func (cli *DebugCli) CreateContainer(attachContainer string, options execOptions
372374
func (cli *DebugCli) ContainerClean(ctx context.Context, id string) error {
373375
ctx, cancel := context.WithTimeout(ctx, time.Second*3)
374376
defer cancel()
375-
timeout := time.Second
377+
var timeout int = 5
376378
return errors.WithStack(cli.client.ContainerStop(
377379
ctx,
378380
id,
379-
&timeout,
381+
container.StopOptions{Timeout: &timeout},
380382
))
381383
}
382384

pkg/tty/hijack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func Copy(ctx context.Context, dst net.Conn, src io.Reader, writeTimeout time.Du
159159
if nr > 0 {
160160
// docker container is stop check
161161
if writeTimeout > 0 {
162-
err = dst.SetReadDeadline(time.Now().Add(writeTimeout))
162+
err = dst.SetWriteDeadline(time.Now().Add(writeTimeout))
163163
if err != nil {
164164
break
165165
}

pkg/tty/tty.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ package tty
22

33
import (
44
"context"
5-
"github.com/sirupsen/logrus"
65
"os"
76
goSignal "os/signal"
87
"runtime"
8+
"syscall"
99
"time"
1010

11-
"github.com/docker/docker/api/types"
11+
"github.com/sirupsen/logrus"
12+
13+
"github.com/docker/docker/api/types/container"
1214
"github.com/docker/docker/client"
13-
"github.com/docker/docker/pkg/signal"
1415
"github.com/zeromake/docker-debug/pkg/stream"
1516
)
1617

@@ -20,7 +21,7 @@ func ResizeTtyTo(ctx context.Context, client client.ContainerAPIClient, id strin
2021
return
2122
}
2223

23-
options := types.ResizeOptions{
24+
options := container.ResizeOptions{
2425
Height: height,
2526
Width: width,
2627
}
@@ -62,7 +63,7 @@ func MonitorTtySize(ctx context.Context, client client.ContainerAPIClient, out *
6263
}()
6364
} else {
6465
sigChan := make(chan os.Signal, 1)
65-
goSignal.Notify(sigChan, signal.SIGWINCH)
66+
goSignal.Notify(sigChan, syscall.Signal(0x1c))
6667
go func() {
6768
for range sigChan {
6869
resizeTty()

scripts/binary.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/env sh
22
#
33
# Build a static binary for the host OS/ARCH
44
#

scripts/upx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/env sh
22
source ./scripts/variables.env
33

44
upx -q ${TARGET} -o ${TARGET}-upx

0 commit comments

Comments
 (0)