update docker

This commit is contained in:
2026-03-27 19:30:22 +01:00
parent d8f1910dd0
commit 1f899cc5e9
4 changed files with 43 additions and 8 deletions

View File

@@ -10,7 +10,7 @@ import (
"sync"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
dockerclient "github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/google/uuid"
@@ -40,7 +40,7 @@ func (s *DockerLogStreamer) Start(ctx context.Context, server *model.Server, han
go func() {
defer s.cancels.Delete(server.ID)
rc, err := s.client.ContainerLogs(streamCtx, server.ContainerID, types.ContainerLogsOptions{
rc, err := s.client.ContainerLogs(streamCtx, server.ContainerID, container.LogsOptions{
ShowStdout: true,
ShowStderr: true,
Follow: true,
@@ -81,7 +81,7 @@ func (s *DockerLogStreamer) GetLastLines(ctx context.Context, server *model.Serv
return []string{}, nil
}
rc, err := s.client.ContainerLogs(ctx, server.ContainerID, types.ContainerLogsOptions{
rc, err := s.client.ContainerLogs(ctx, server.ContainerID, container.LogsOptions{
ShowStdout: true,
ShowStderr: true,
Tail: strconv.Itoa(n),

View File

@@ -11,7 +11,6 @@ import (
"strconv"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
dockerclient "github.com/docker/docker/client"
@@ -94,7 +93,7 @@ func (r *DockerRuntime) Delete(ctx context.Context, serverID uuid.UUID) error {
return nil
}
err = r.client.ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{
err = r.client.ContainerRemove(ctx, containerID, container.RemoveOptions{
Force: true,
RemoveVolumes: false,
})
@@ -119,7 +118,7 @@ func (r *DockerRuntime) Start(ctx context.Context, serverID uuid.UUID) (string,
return "", err
}
if err := r.client.ContainerStart(ctx, containerID, types.ContainerStartOptions{}); err != nil {
if err := r.client.ContainerStart(ctx, containerID, container.StartOptions{}); err != nil {
return "", fmt.Errorf("failed to start container: %v", err)
}
return model.StatusRunning.String(), nil
@@ -209,7 +208,7 @@ func (r *DockerRuntime) resolveContainerID(ctx context.Context, serverID uuid.UU
}
func (r *DockerRuntime) findContainerByName(ctx context.Context, name string) (string, error) {
containers, err := r.client.ContainerList(ctx, types.ContainerListOptions{
containers, err := r.client.ContainerList(ctx, container.ListOptions{
All: true,
Filters: filters.NewArgs(filters.Arg("name", "/"+name)),
})