Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (32 sloc) 721 Bytes
// +build linux freebsd
package dockerplugin
import (
"net"
"os"
"path/filepath"
"github.com/docker/go-connections/sockets"
)
const (
pluginSockDir = "/run/docker/plugins"
)
func newUnixListener(
volumeDriverName string,
group string,
) (net.Listener, string, error) {
path, err := fullSocketAddress(volumeDriverName)
if err != nil {
return nil, "", err
}
listener, err := sockets.NewUnixSocket(path, group)
if err != nil {
return nil, "", err
}
return listener, path, nil
}
func fullSocketAddress(address string) (string, error) {
dir := filepath.Join(pluginSockDir, address)
if err := os.MkdirAll(dir, 0755); err != nil {
return "", err
}
return filepath.Join(dir, address+".sock"), nil
}