mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-07 14:32:09 +00:00
Extract sockets initialization to a package.
Because I just used it somewhere else and it would be nice if I didn't have to copy and paste the code. Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/daemon"
|
||||
)
|
||||
|
||||
@@ -19,13 +18,8 @@ func (s *Server) newServer(proto, addr string) (Server, error) {
|
||||
)
|
||||
switch proto {
|
||||
case "tcp":
|
||||
if !s.cfg.TlsVerify {
|
||||
logrus.Warn("/!\\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\")
|
||||
}
|
||||
if l, err = NewTcpSocket(addr, tlsConfigFromServerConfig(s.cfg)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := allocateDaemonPort(addr); err != nil {
|
||||
l, err = s.initTcpSocket(addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user