Docker-compose not available with docker:dind?

Dear GitLab support!

My dockerized Scala application uses GitLab CI for testing and deploying.
Deploying works fine, but for testing I require docker-compose to be available since the tests run against the application’s containers.

In the .gitlab-ci.yml I use Docker In Docker with

  - docker:dind

The base image provides Docker and SBT for building the app.

If I have understood the docs correctly, dind includes Docker Compose.

Yet when I execute my tests with dockerComposeTest, an SBT task provided by this nice plugin that uses Docker Compose to start up the app’s containers and runs tests against them, I get the following error: Cannot run program “docker-compose”: error=2, No such file or directory

How can I make docker-compose available in that job so the SBT task can use it?

Thanks a lot in advance!

1 Like

Bump, because have the exact same question.

docker-compose is not included in docker:latest image.
You can create your own image based on docker:latest with a Dockerfile like this one, which is inspired by the official dockerfile from

FROM docker:latest
ENV GLIBC 2.23-r3
RUN apk update && apk add --no-cache openssl ca-certificates && \
    wget -q -O /etc/apk/keys/ && \
    wget$GLIBC/glibc-$GLIBC.apk && \
    apk add --no-cache glibc-$GLIBC.apk && rm glibc-$GLIBC.apk && \
    ln -s /lib/ /usr/glibc-compat/lib/ && \
    ln -s /lib/ /usr/glibc-compat/lib && \
    wget`uname -s`-`uname -m` -O /usr/local/bin/docker-compose && \
    chmod +x /usr/local/bin/docker-compose

Thanks perrinl, I will try that.