# Docker-compose up

**URL:** <https://discuss.circleci.com/t/docker-compose-up/36024>\
**Category:** Build Environment\
**Tags:** docker\
**Created:** [May 21, 2020, 7:27am UTC](https://discuss.circleci.com/t/docker-compose-up/36024 "2020-05-21T07:27:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mg98](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mg98/32/24987_2.png) [@mg98](https://discuss.circleci.com/u/mg98)\
**Post date:** [May 21, 2020, 7:27am UTC](https://discuss.circleci.com/t/docker-compose-up/36024/1 "2020-05-21T07:27:39Z")

</div>

Hello,

I’m new to CircleCI and I haven’t set up too many CIs in general yet.  
My project is dockerized. It has a `docker-compose.yml` that runs `postgres` and an image that it builds from `Dockerfile`.

I want my tests in CI to be run inside the docker container by using the same `docker-compose.yml`. From what I’ve seen you’re building your docker environment inside the circleci config. But I don’t want to repeat myself in this file. It’s not _DRY_. I wish that I would bet let to just run `docker-compose up` and then run my test suite. It should also cache the docker images.

Can someone guide me in the right direction?

---

<div class="post-metadata">

**Author:** ![gmemstr](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/gmemstr/32/22922_2.png) [@gmemstr](https://discuss.circleci.com/u/gmemstr)\
**Post date:** [May 21, 2020, 10:21am UTC](https://discuss.circleci.com/t/docker-compose-up/36024/2 "2020-05-21T10:21:21Z")

</div>

Hi @mg98! We offer a machine executor, which would allow you to run Docker and docker-compose commands as you normally would: [https://circleci.com/docs/2.0/executor-types/#using-machine](https://circleci.com/docs/2.0/executor-types/#using-machine). However, the images may not be cached. The best way would be to utilise the Docker executor with multiple images, which would increase the chances of the image being cached: [https://circleci.com/docs/2.0/executor-types/#using-docker](https://circleci.com/docs/2.0/executor-types/#using-docker). While I understand the want to not repeat configuration, there can be advantages to doing so, such as fine-tuning the image used (e.g using one of our convenience images in the pipeline, and a custom image locally).

---

<div class="post-metadata">

**Author:** ![mg98](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mg98/32/24987_2.png) [@mg98](https://discuss.circleci.com/u/mg98)\
**Post date:** [May 21, 2020, 5:54pm UTC](https://discuss.circleci.com/t/docker-compose-up/36024/3 "2020-05-21T17:54:26Z")

</div>

Hello @gmemstr! Thanks for the explanation. I’m confused by the phrase “increase the chances of the image being cached” That’s not how computers work, is it? 😂 Can you elaborate on that? 🙂 In which circumstances would the image be cached on a machine executor for example?
