1

when i start a docker containner on mesos-slave

the mesos-slave log shows that:

I1223 15:38:40.822557 258486272 docker.cpp:761] Starting container 'ea1ed2fa-c2e3-469a-bcc4-142e0a6c624d' for task '2-1.2fb839ea-a948-11e5-9c42-2e7bf2aa25a6' (and executor '2-1.2fb839ea-a948-11e5-9c42-2e7bf2aa25a6') of framework '13165a00-8e58-4d80-b84d-fe4652022a3e-0000'
E1223 15:38:41.219044 254730240 slave.cpp:3342] Container 'ea1ed2fa-c2e3-469a-bcc4-142e0a6c624d' for executor '2-1.2fb839ea-a948-11e5-9c42-2e7bf2aa25a6' of framework '13165a00-8e58-4d80-b84d-fe4652022a3e-0000' failed to start: Failed to 'docker -H unix:///var/run/docker.sock pull python:3': exit status = exited with status 1 stderr = An error occurred trying to connect: Post https:///var/run/docker.sock/v1.19/images/create?fromImage=python%3A3: dial unix /var/run/docker.sock: no such file or directory

from that, i can see mesos-slave excute docker -H unix:///var/run/docker.sock pull python:3 to download images.

but I use Mac OSX, And the docker is running in the vm , So there is no docker.sock file in my slave but the vm.

How cuold i solve the issue on Mac OSX? please help me ,thanks!

KingOfSocket
  • 293
  • 5
  • 18
  • So, you're running Mesos natively on Mac OS? And Docker is running with docker-machine? – Tobi Dec 23 '15 at 09:49
  • i just use boot2docker , not the docker-machine , do you have any idea for me ?, thanks – KingOfSocket Dec 23 '15 at 09:52
  • Mesos Master and Slave is also started via boot2docker? If so, you'll need to pass in the Docker socket as volume. Have a look at https://github.com/tobilg/coreos-setup/blob/master/etc/systemd/system/mesos-slave.service#L18 – Tobi Dec 23 '15 at 10:34
  • no , I run master and slave on my host, i boot all the things on only one machine – KingOfSocket Dec 24 '15 at 01:38
  • my ip is 192.168.168.128 , so the master and slave ip is 192.168.168.128, but boot2docker vm ip is 192.168.59.103, when mesos-slave create docker container , it will excute `docker -H unix:///var/run/docker.sock pull`, but my os is not linux, the file `docker.socke` is in my boot2docker vm , so it failed – KingOfSocket Dec 24 '15 at 01:41
  • @KingOfSocket you can pass `DOCKER_HOST=tcp://192.168.59.103:2375` environment variable when starting mesos-slave by using `--executor_environment_variables` more info [here](http://mesos.apache.org/documentation/latest/configuration/) Check if that resolves the issue – V.G Dec 25 '15 at 21:37
  • @V.G I start mesos with `--executor_environment_variables` and set the `DOCKER_HOST` , but the it told me the same error .... – KingOfSocket Dec 28 '15 at 06:24

1 Answers1

0

I had this issue too. I was trying to run zookeeper, mesos, marathon, and friends all in one docker-compose file with my mac.

Trying to run things in marathon would cause the exact error that you got. I discovered that the docker daemon was not running on the slave. All I had to do was start it: docker exec <mesos-slave-container-name> sudo service docker start.

From then on, I was able to run docker containers using marathon.

John Ruiz
  • 2,371
  • 3
  • 20
  • 29