ServeTCP makes the handler to listen for request in a given TCP address. It also writes the spec file in the right directory for docker to read. Due to constrains for running Docker in Docker on Windows, data-root directory of docker daemon must be provided. To get default directory, use WindowsDefa
(pluginName, addr, daemonDir string, tlsConfig *tls.Config)
| 43 | // of docker daemon must be provided. To get default directory, use |
| 44 | // WindowsDefaultDaemonRootDir() function. On Unix, this parameter is ignored. |
| 45 | func (h Handler) ServeTCP(pluginName, addr, daemonDir string, tlsConfig *tls.Config) error { |
| 46 | l, spec, err := newTCPListener(addr, pluginName, daemonDir, tlsConfig) |
| 47 | if err != nil { |
| 48 | return err |
| 49 | } |
| 50 | if spec != "" { |
| 51 | defer os.Remove(spec) |
| 52 | } |
| 53 | return h.Serve(l) |
| 54 | } |
| 55 | |
| 56 | // ServeUnix makes the handler to listen for requests in a unix socket. |
| 57 | // It also creates the socket file in the right directory for docker to read. |