mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Merge pull request #100 from gtardif/windows_grpc
Allow server to start on tcp port or if windows, named pipe rather than unix socket
This commit is contained in:
commit
2e8251fb2d
6 changed files with 55 additions and 5 deletions
|
|
@ -2,7 +2,6 @@ package cmd
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
|
@ -39,10 +38,12 @@ func ServeCommand() *cobra.Command {
|
|||
func runServe(ctx context.Context, opts serveOpts) error {
|
||||
s := server.New()
|
||||
|
||||
listener, err := net.Listen("unix", opts.address)
|
||||
listener, err := server.CreateListener(opts.address)
|
||||
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "listen unix socket")
|
||||
return errors.Wrap(err, "listen address "+opts.address)
|
||||
}
|
||||
|
||||
// nolint errcheck
|
||||
defer listener.Close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue