Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
0xff8 authored and dguerri committed Sep 10, 2023
1 parent a3932df commit e1aaa57
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions cmd/dockerfuse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
var (
containerID string
mountPoint string
path string
daemonize bool
printVersion bool
// Version holds the version tag, and it is set at build-time
Expand All @@ -39,11 +40,14 @@ func init() {
flag.BoolVar(&printVersion, "version", false, "Print the version and exit")
flag.BoolVar(&printVersion, "v", false, "Print the version and exit")

flag.StringVar(&containerID, "id", "", "Docker containter ID (or name)")
flag.StringVar(&containerID, "i", "", "Docker containter ID (or name)")
flag.StringVar(&containerID, "id", "", "Docker container ID (or name)")
flag.StringVar(&containerID, "i", "", "Docker container ID (or name)")

flag.StringVar(&mountPoint, "mount", "", "Mount point for containter FS")
flag.StringVar(&mountPoint, "m", "", "Mount point for containter FS")
flag.StringVar(&mountPoint, "mount", "", "Mount point for container FS")
flag.StringVar(&mountPoint, "m", "", "Mount point for container FS")

flag.StringVar(&path, "path", "/", "Path inside the container")
flag.StringVar(&path, "p", "/", "Path inside the container")

flag.BoolVar(&daemonize, "daemonize", false, "Daemonize fuse process")
flag.BoolVar(&daemonize, "d", false, "Daemonize fuse process")
Expand All @@ -53,7 +57,7 @@ func init() {
func main() {
flag.Parse()
if printVersion {
fmt.Printf("DockerFuse\nVersion: %s\nGit commmit: %s\n", Version, GitCommit)
fmt.Printf("DockerFuse\nVersion: %s\nGit commit: %s\n", Version, GitCommit)
os.Exit(0)
}

Expand Down Expand Up @@ -101,15 +105,15 @@ func main() {

fuseDockerClient, err := client.NewDockerFuseClient(containerID)
if err != nil {
log.Panicf("error initiazializing docker client: %s", err)
log.Panicf("error initializing docker client: %s", err)
} else {
log.Printf("docker client created")
}

log.Printf("mounting FS to %v...", mountPoint)
vEntryTTL := entryTTL
vAttrTTL := attrTTL
server, err := fs.Mount(mountPoint, client.NewNode(fuseDockerClient, "/", ""), &fs.Options{
server, err := fs.Mount(mountPoint, client.NewNode(fuseDockerClient, path, ""), &fs.Options{
EntryTimeout: &vEntryTTL,
AttrTimeout: &vAttrTTL,
NegativeTimeout: &vEntryTTL,
Expand Down

0 comments on commit e1aaa57

Please sign in to comment.