Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samba - nothing to share + fix #38

Open
niccokunzmann opened this issue Dec 14, 2015 · 6 comments
Open

Samba - nothing to share + fix #38

niccokunzmann opened this issue Dec 14, 2015 · 6 comments

Comments

@niccokunzmann
Copy link

Observation
When I run

docker run -v /data --name my-data busybox true 
docker run --rm -v /usr/local/bin/docker:/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba my-data

I get

my-data has no volumes - nothing to share.

Fix

The error is in line 90.
When I run

docker inspect --format="{{range \$k,\$v := .Volumes}}{{println \$k}}{{end}}" my-data

I get no output. But, when I add .Config it works.

docker inspect --format="{{range \$k,\$v := .Config.Volumes}}{{println \$k}}{{end}}" my-data

Output:

/data

Docker Version: 1.9.1
API Version: 1.21

Solution

I guess this is due to old docker versions that hat a .Volumes attribute. I suggest the following:

  1. Keep the old query intact in case there is an old version
  2. Add a new query with .Config
@niccokunzmann
Copy link
Author

Pull request 32 fixes this.

@larrycai
Copy link
Contributor

To my case under 1.9.1, I just see null under .Config.Volumes , therefore I can't use samba now. Any hints ?

   "Config": {
        ...
        "Cmd": [
            "true"
        ],
        "Image": "busybox",
        "Volumes": null,
       ...

see sto question: http://stackoverflow.com/questions/35032368/docker-volumes-doesnt-exist-for-data-container-in-1-9-1

@larrycai
Copy link
Contributor

In sto, VonC mentioned to use Mounts instead of .Config.Volumes, do you agree ?

@niccokunzmann
Copy link
Author

Could you try the line on the command line, post the output and adapt it to the mounts? I do not know:

docker inspect --format="{{range \$k,\$v := .Config.Volumes}}{{println \$k}}{{end}}" my-data

@larrycai
Copy link
Contributor

@niccokunzmann I made a simple PR based on your solution with new checking for Mounts, or you can redo your PR since it is too complex and modify too much.

@larrycai
Copy link
Contributor

Don't have time and best solution to this fix (my PR has issues), any one to provide a simple PR for this ?

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

No branches or pull requests

2 participants