Run command docker-compose not working

Let’s start with my system configuration :

  • Docker
    I was under the beta13 version (today’s one 27/05/16) sorry i can’t tell you the exact version now i delete it.

  • Mac OSX El capitan 2,7 i5, 8Go

Now the problem.

I made 3 containers : with docker-compose

  • api -> Rails api
  • web -> Angular webpack
  • db -> Mongodb

The code is nothing crazy, just a scaffolding and a csv seeds.
When i want to seed my database, i have a connection error. i tried many thing, but nothing work until i changed to the docker-machine and uninstall docker native.

I got an error when running docker-compose run api rake db:seed

Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x47121755943460 tag_sets=[] server_selection_timeout=30 local_threshold=0.015>

And the same command with docker-machine environment working.
(of course i just change the docker ip addresse from localhost to Dockermachine ip)

Hope this will help someone, or could be fix.