Running tests via docker-compose



I’m having some trouble running tests on CircleCI using the docker-compose.yml file we use to test locally.

What I want to do is:

  • Spin up services using docker-compose up -d
  • Have port mappings of aforementioned services to localhost
  • Run tests (e.g. boot test)

The article on docker-compose suggests that this can’t be done with the docker engine:

Note: The primary container runs in a seperate environment from Remote Docker and the two cannot communicate directly. To interact with a running service, use docker and a container running in the service’s network.

If you want to use docker compose to manage a multi-container setup, use the machine key in your config.yml file and use docker-compose as you would normally.

So it seems that using machine instead of docker is the way to go. However, the choice of images to run via machine seems rather limited. In particular, I’ve had trouble installing sassc:

sassc: relocation error: sassc: symbol _ZTVNSt7__cxx1119basic_istringstreamIcSt11char_traitsIcESaIcEEE, version GLIBCXX_3.4.21 not defined in file with link time reference

Seems to me that another option is possible: include the app as a service in docker-compose.yml and run tests through it. Is there an example of this that I can refer to?

How to change node version in CircleCI 2.0?

I’ve worked around the sassc compilation problem for now by using sassc through a Docker image.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.