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

Drone container linking problem [0.3.0-alpha] #945

Closed
wdalmut opened this issue Apr 1, 2015 · 2 comments
Closed

Drone container linking problem [0.3.0-alpha] #945

wdalmut opened this issue Apr 1, 2015 · 2 comments

Comments

@wdalmut
Copy link

wdalmut commented Apr 1, 2015

Hi,

i am trying to work with drone and I have a problem with services. i have to set of integration tests that runs agains a mongodb database.

My drone file is this one:

image: wdalmut/php:5.5
services:
  - wdalmut/mongo:2.6
script:
  - echo "date.timezone=Europe/Rome" > /usr/local/etc/php/php.ini
  - echo "memory_limit=512M" >> /usr/local/etc/php/php.ini
  - curl -Ss http:https://getcomposer.org/installer | php
  - php composer.phar install
  - bin/phpunit -c app

The script section works correctly and the container is correctly prepared and executed. Same things for the MongoDB service that is effectively started as described in my .drone.yml

The problem is that containers are not linked and my testing scenarios cannot connect to mongodb using "locahost:27017".

I have also inspected both containers and there is no linking between them.

I checked out the docs and i see that the .drone.yml is correctly configured. There is anything that i'm missing?

Thanks
Walter

@bradrydzewski
Copy link

Hey there, you'll want to install socat inside your wdalmut/php:5.5 image. Drone uses socat in order to proxy linked containers over localhost (this will change in drone 0.4, but is required for now). You'll also need to ensure port 27017 is exposed in your mongo Dockerfile, similar to the following:
https://github.com/drone/images/blob/master/database/mongodb/mongodb_2.4/Dockerfile

Drone will use the remote API to inspect exposed ports and automatically link to your build container.

Feel free to jump into Gitter if you have any further questions:
https://gitter.im/drone/drone

@wdalmut
Copy link
Author

wdalmut commented Apr 1, 2015

@bradrydzewski thanks you so much!!

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