mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Create a new client on each request
`docker serve` doesn't need a context any more, the server takes the current context from the request metadata and creates a new client
This commit is contained in:
parent
9ea91791b4
commit
8571cf5a04
6 changed files with 49 additions and 27 deletions
|
|
@ -5,7 +5,6 @@ import (
|
|||
"net"
|
||||
|
||||
cliv1 "github.com/docker/api/cli/v1"
|
||||
"github.com/docker/api/client"
|
||||
"github.com/docker/api/containers/proxy"
|
||||
containersv1 "github.com/docker/api/containers/v1"
|
||||
"github.com/docker/api/context/store"
|
||||
|
|
@ -45,12 +44,7 @@ func runServe(ctx context.Context, opts serveOpts) error {
|
|||
}
|
||||
defer l.Close()
|
||||
|
||||
c, err := client.New(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
p := proxy.NewContainerApi(c)
|
||||
p := proxy.NewContainerApi()
|
||||
|
||||
containersv1.RegisterContainersServer(s, p)
|
||||
cliv1.RegisterCliServer(s, &cliServer{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue