Reputation: 2046
I have created some integration tests for my open-sourced code and I am looking for a publicly accessible CI service to host them. As Travis-CI has to small quotas for all my containers, I think I will use CircleCI. This is my cirle.yml
:
machine:
services:
- docker
dependencies:
override:
- pip install docker-compose
test:
override:
- cd integration-tests && docker-compose run --rm runner
However after running this I get error message "client and server don't have same version (client : 1.18, server: 1.16)" What is my problem?
Upvotes: 1
Views: 1485
Reputation: 992
you can do this by using --net=host
when running your container, this will allow you to access Circle CI services via localhost
. With this you don't need to use docker-compose
. Circle CI provides most services for you.
machine:
services:
- docker
- mysql
- redis
...
test:
override:
- |
docker run \
--net=host \
--env MYSQL_HOST=localhost \
--env MYSQL_PORT=3306 \
--env MYSQL_DATABASE=circle_test \
--env MYSQL_USERNAME=ubuntu \
--env REDIS_HOST=localhost \
--env REDIS_PORT=$REDIS_PORT \
my/container runner
Upvotes: 0
Reputation: 656
UPDATE: It's not needed anymore, CircleCI has Docker v1.8.2 by default now
You can update docker version like this:
machine:
services:
- docker
pre:
- docker --version
- sudo curl -L -o /usr/bin/docker 'http://s3-external-1.amazonaws.com/circle-downloads/docker-1.8.2-circleci'
- sudo chmod 0755 /usr/bin/docker
- docker --version
You can replace 1.8.2
in the amazon S3 link to the version you want
Upvotes: 0
Reputation: 543
@zefciu This config just worked for me
machine:
services:
- docker
dependencies:
override:
- sudo pip install -U docker-compose==1.3.3
test:
override:
- docker-compose -f <compose-file> build && docker-compose -f <compose-file> up
Upvotes: 2
Reputation: 2046
With extensive help of Support and some trial and error I found two problems with my configuration:
The correct configuration therefore will look like this:
machine:
services:
- docker
pre:
- sudo curl -sSL https://get.docker.com/ | sh
dependencies:
override:
- pip install docker-compose
test:
override:
- cd integration-tests && docker-compose run runner
Upvotes: 1