fix: some test
This commit is contained in:
@@ -2,6 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
@@ -30,6 +32,19 @@ func startContainer(cfg *container.Config, hostCfg *container.HostConfig, name s
|
||||
return "", err
|
||||
}
|
||||
|
||||
response, err := c.ContainerAttach(context.Background(), container.ID, types.ContainerAttachOptions{
|
||||
Stdout: true,
|
||||
Stderr: true,
|
||||
Logs: true,
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
go func() {
|
||||
response.Reader.WriteTo(os.Stderr)
|
||||
}()
|
||||
|
||||
return container.ID, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user