Does anyone have a working example of docker-compose within DinD?

Hello all!

I have been trying for a while to use docker-compose with DinD and I do not manage to have it working. Does anyone have a working example?

I have the following but it fails because compose says " Path to a certificate and key files must be provided through the client_config param" which might be related to TLS. I am running on shared runners to make sure there is not gitlab-runner misconfiguration.

I use gitlab.com directly, not a self-hosted version.

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: '/certs'  
test_server:
  tags:
    - docker
  stage: test
  image: docker:19.03.12
  services:
    - name: docker:19.03.12-dind
      alias: localhost

  before_script:
    - apk update && apk add --no-cache curl
    - curl -L --fail https://github.com/docker/compose/releases/download/1.25.5/run.sh -o /usr/local/bin/docker-compose
    - chmod +x /usr/local/bin/docker-compose
    - echo "$CI_JOB_TOKEN" | docker login -u $CI_REGISTRY_USER --password-stdin $GITLAB_REGISTRY
  script:
    - cd Application/server
    - docker pull $SERVER_TESTING_IMAGE_NAME:latest || true
    - docker-compose --project-directory . -f ./config/docker-compose-testing.yml build --no-cache

Thank you in advance and kind regards.

Hi @dejavits
Shared runners have Docker TLS disabled out of the box. If you must use TLS I think the right path according to configuration of shared runners is /certs/client

Thanks! At the end I have just removed docker-compose as it was impossible to use it. I wasted so much time already so I decided to replace my compose with a bunch of “docker run” commands; Not clean, but it works.