Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

/var/lib/docker/plugins required to exist at docker plugin install time #25

Closed
xemdetia opened this issue Aug 8, 2017 · 4 comments · Fixed by #30
Closed

/var/lib/docker/plugins required to exist at docker plugin install time #25

xemdetia opened this issue Aug 8, 2017 · 4 comments · Fixed by #30

Comments

@xemdetia
Copy link

xemdetia commented Aug 8, 2017

I have a nonstandard filesystem layout for docker and installing this plugin gives me this error unless I make /var/lib/docker/plugins:

$ docker plugin install vieux/sshfs DEBUG=1
Plugin "vieux/sshfs" is requesting the following privileges:
 - network: [host]
 - mount: [/var/lib/docker/plugins/]
 - device: [/dev/fuse]
 - capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y
latest: Pulling from vieux/sshfs
a23658ccfda2: Download complete 
Digest: sha256:d33ffa08df2a4fa87f83fded4ac3ac2e3a96d296c55aa1a0afce33fb2cc7b9b0
Status: Downloaded newer image for vieux/sshfs:latest
Error response from daemon: rpc error: code = 2 desc = oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/var/lib/docker/plugins/\\\" to rootfs \\\"/opt/docker/docker-official/graph/plugins/6229d8108d4ceb0dedc25af4c131cdc45df1a43a2ed3621e24f8a2a43f0b8e99/rootfs\\\" at \\\"/mnt/state\\\" caused \\\"stat /var/lib/docker/plugins/: no such file or directory\\\"\""

I can't seem to find a reason in the code as it's requirement to this directory. Once I make the directory the issue goes away. I do not run docker as the root user so if it is supposed to auto-create it I do not have permissions to.

I do see that it is mentioned explicitly in the configuration in the mounts blob:

            "Mounts": [
                {
                    "Description": "",
                    "Destination": "/mnt/state",
                    "Name": "",
                    "Options": [
                        "rbind"
                    ],
                    "Settable": null,
                    "Source": "/var/lib/docker/plugins/",
                    "Type": "bind"
                }
            ]
@vieux
Copy link
Owner

vieux commented Aug 14, 2017

@xemdetia thanks for the report, You are right I hardcoded /var/lib/docker/plugins/ assuming it would always exists, but it might not, I'll look into this.

@vieux
Copy link
Owner

vieux commented Aug 25, 2017

@xemdetia it's far from perfect, but once https://github.com/vieux/docker-volume-sshfs/pull/30/files is merged, you will be able to set this var to any value you desire.

@vieux vieux closed this as completed in #30 Aug 25, 2017
@xemdetia
Copy link
Author

Great! Thank you!

@MarcinWieczorek
Copy link

You may have assumed that because by default docker home is in /var/lib/docker. Thank you for allowing that variable to be settable, but I think defaulting to Docker Root Dir as in docker info would be better.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants