Skip to content

Instantly share code, notes, and snippets.

@cameronmaske
Last active August 10, 2018 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronmaske/ad032c7709cf8b9fc1da4ad8df908450 to your computer and use it in GitHub Desktop.
Save cameronmaske/ad032c7709cf8b9fc1da4ad8df908450 to your computer and use it in GitHub Desktop.
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: https://cameronmaske.com/comparing-3-continous-intergration-services-for-docker-compose/

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