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 isn't working #1

Open
lazywei opened this issue May 15, 2014 · 11 comments
Open

Samba isn't working #1

lazywei opened this issue May 15, 2014 · 11 comments

Comments

@lazywei
Copy link

lazywei commented May 15, 2014

When I use

docker run --rm -v $(which docker):/docker -v /run/docker.sock:/docker.sock svendowideit/samba MY_CONTAINER

I got

Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

I also tried

docker run --rm -v $(which docker):/docker -v $(readlink -f /var/run/docker.sock):/docker.sock -e $DOCKER_HOST svendowideit/samba MY_CONTAINER

and

docker run --rm -v $(which docker):/docker -v $(readlink -f /var/run/docker.sock):/docker.sock -e DOCKER_HOST svendowideit/samba MY_CONTAINER

but all failed.

@SvenDowideit
Copy link
Owner

I'm going to have to debug this tomorrow, as I'm about to goto bed.

where are you running docker from? Cannot connect may well mean you need to set the DOCKER_HOST, but that assumes you're running the docker client on your OSX box.

(tell me more :) )

@lazywei
Copy link
Author

lazywei commented May 15, 2014

Have a good night :-)

I run docker from my OSX (i.e. host computer)

$ echo $DOCKER_HOST
tcp://localhost:4243

and other docker commands work fine:

$ docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
svendowideit/samba   latest              8292b93ea1c7        9 days ago          303.4 MB
ubuntu               13.10               5e019ab7bf6d        2 weeks ago         180 MB

@SvenDowideit
Copy link
Owner

mmm, frustrating. it works for me on my test OSX box (the first version you tried)

@lazywei
Copy link
Author

lazywei commented May 18, 2014

should i use docker version below 0.11.1?

so what is the correct way to run this? could you give me your steps, and i can try if i make any mistake?

thanks


Regards,
Chih-Wei

On Sun, May 18, 2014 at 12:50 PM, Sven Dowideit [email protected]
wrote:

mmm, frustrating. it works for me on my test OSX box (the first version you tried)

Reply to this email directly or view it on GitHub:
#1 (comment)

@SvenDowideit
Copy link
Owner

na, it was only one out of 3 of my 0.11.1 setups that was weird, and it came good after a reboot.

so, what I ran from my OSX terminal was:

export DOCKER_HOST=tcp://localhost:4243
docker run -v /data --name data busybox true
docker run -v $(which docker):/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba data

and that resulted in a samba share that I could access from my OSX finder using the host only network on the boot2docker vm (in my case 192.168.59.103 (if you boot2docker ssh, you can run ip addr to see if that is the right ip address for eth1

@lazywei
Copy link
Author

lazywei commented May 18, 2014

OK. So I tried boot2docker status, it gives me: [2014-05-18 14:27:43] boot2docker-vm is aborted. (I'm not sure what is the problem here?)
I then stop & restart boot2docker, and try your steps:

$ docker run -v /data --name data busybox true
Unable to find image 'busybox' locally
Pulling repository busybox
2d8e5b282c81: Download complete
511136ea3c5a: Download complete
6c991eb93460: Download complete
9f4e93171ec5: Download complete
$ docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
svendowideit/samba   latest              8292b93ea1c7        11 days ago         303.4 MB
ubuntu               13.10               5e019ab7bf6d        3 weeks ago         180 MB
busybox              latest              2d8e5b282c81        3 weeks ago         2.489 MB
$ docker ps -a
CONTAINER ID        IMAGE                  COMMAND                CREATED             STATUS                     PORTS               NAMES
b35156b7b621        busybox:latest         true                   9 seconds ago       Exited (0) 7 seconds ago                       data
$ docker run -v $(which docker):/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba data
Error: No such image or container: samba-server

@SvenDowideit
Copy link
Owner

aborted means that the vm is not running.

The last means that it worked. You should see a samba container using docker ps and then be able to connect to it.

I'll have to improve the output, but i've not yet worked out a good consistent way to tell the user what IP address to connect to (now that we have --net host that should be simpler.

@lazywei
Copy link
Author

lazywei commented May 18, 2014

OK. I can see samba now, thank you! But how can I connect to it? And how to access the "shared folders"?

In your case, you use a container "data". So the samba will also sync the folder between my OSX and that "data" container, right? If I want to use this samba-server in development, say Rails, I can create a container for Rails, and use

$ docker run -v $(which docker):/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba RAILS_CONTAINER

right?

@SvenDowideit
Copy link
Owner

You connect to it like you do any other network share - it is likely to be at \192.168.59.103\data - but I'll need to go see what you do in OSX

@mbinette
Copy link

I am doing the exact same thing but from a Windows machine. I believe you are also using Windows. I have a clean boot2docker VM running in VirtualBox using the boot2docker-cli tool. I created a home-vol as in your example using:

$ docker run -v /home --name home-vol busybox true

I then try to run

$ docker run --rm -v $(which docker):/docker -v $(readlink -f var/run/docker.sock):/docker.sock svendowideit/samba home-vol

But all I get is

Error: Could not create local directory '' for bind mount: mkdir : no such file or directory!

Is there something simple I'm doing wrong?

@psykomo
Copy link

psykomo commented Jun 14, 2014

@mbinette try this command:

docker run -v $(which docker):/docker -v /var/run/docker.sock:/docker.sock -e DOCKER_HOST svendowideit/samba home

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

4 participants