Skip to content

Instantly share code, notes, and snippets.

Last active August 10, 2018 13:15
What would you like to do?
How to use CircleCI's docker executor instead of machine for a Docker Compose project

Docker Compose workarounds with CircleCI's docker executor.

Here is an example configuration with the work arounds listed below.

If you need to build Docker images (which our project does) you have to tell Circle to set up a remote docker environment to execute any docker commands. This isn't necessarily complex to add your configuration, it's a simple one-line addition.

However, it is not possible to mount folders (i.e the volumes key in Docker Compose) for containers run by the remote docker instance.

This means you either to set up a separate docker-compose.yml, without volumes and in your Dockerfile, make sure to ADD any folders/code that you need available to run your tests.

Alternatively, you can start up a container, and copy files over (using docker cp). Due to this, the machine executor requires less configuration and from my experimentation has a negligible impact on the speed at which tests are run.

Full post:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment