forked from ucphhpc/docker-volume-sshfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
34 lines (28 loc) · 737 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"os"
"strconv"
log "github.com/Sirupsen/logrus"
"github.com/docker/go-plugins-helpers/volume"
)
const (
// DefaultBasePath defines the base path within the docker plugins rootfs file system
DefaultBasePath = "/mnt"
// DefaultUnixSocket sets the path to the plugin socket
DefaultUnixSocket = "/run/docker/plugins/sshfs.sock"
)
func main() {
debug := os.Getenv("DEBUG")
if ok, _ := strconv.ParseBool(debug); ok {
log.SetLevel(log.DebugLevel)
} else {
log.SetLevel(log.InfoLevel)
}
driver, err := newSshfsDriver(DefaultBasePath)
if err != nil {
log.Errorf("Failed to create the driver %s", err)
os.Exit(1)
}
handler := volume.NewHandler(driver)
handler.ServeUnix(DefaultUnixSocket, 0)
}