If you look at the documentation for “Specifying Container Images”, under the heading “Using Multiple Docker Images” it explains that listing multiple container images should be used when you have external services you depend on (such as a database or caching system). These external services are expected to expose a network port which will then be made available to the primary image. More importantly:
In a multi-image configuration job, all steps are executed in the container created by the first image listed.
Based on the configuration you provided, this means that all your commands are being run inside the
Since you have a situation which requires a complex set of dependencies, you can either install additional dependencies inline during your test run or (recommended) build your own Docker image that contains the exact dependencies you need. CircleCI provides instructions on how to build and publish your own Docker image for this purpose. My team at work uses this method, and it has significantly reduced are set-up time during tests.