Docker-compose in C.I. with cache?

Here is my .gitlab-ci.yml:

My build works, but it’s really slow, and I know this is due to caching not happening.

I’ve read this thread:

but I’m unsure if it’s even relevant to a docker-compose setup, as compose has its own naming conventions for docker images.

Has anyone figured out a way to run docker-compose tests?

In case anyone thinks ‘why not just use docker?’ – well, for server-side apps, it’s handy to have docker-compose manage the environment variables and extra services that a server may need to interact with.

For the linked .gitlab-ci.yml, I could just use docker, as my ember app doesn’t require additional services. But, I think figuring out a docker-compose solution is still valuable (I have a few other projects that have to use docker-compose)


You can use cache_from.
Something like:

version: '3.2'


      context: .
      dockerfile: Dockerfile
        - test/test
    image: test/test

And then use the registry like a cache:

docker-compose pull
docker-compose build
docker-compose push