I'm gonna try to explain what my recently found headache is. First of all I'm using Gitlab CI so docker and docker in docker is involved.

The structure of the CI is basically this and all running dind:

  1. Stand UP 3 services for 3 different databases using docker-compose up -d
  2. Once the services are up, run a test service with docker-compose run test from another docker compose file in a different directory and all the services there are using the same network

Previously this entire pipeline was working using docker in docker but until recently i'm talking in the last 3 weeks it broke, I tried to do the same locally and the databases connect just fine. But when running inside the CI I get:

ERROR 2003 (HY000): Can't connect to MySQL server on 'dbtest' (111 "Connection refused")

I'm using the latest mariadb docker, I've tried to override the bind-address to listen to all interfaces with no luck, and I still get connection refused, I've tried the alias and the container name but I still get the same error.

This is the compose file for the database services

version: '2'

        driver: local


        image: mariadb:latest
        container_name: core-dbtest
        - ./db/schema/:/docker-entrypoint-initdb.d
            MYSQL_ROOT_PASSWORD: <some_pass>
            MYSQL_DATABASE: <some_db>
            MYSQL_USER: <some_user>
            MYSQL_PASSWORD: <some_password>
            - test



  • Could it be that the server is still listening on localhost regardless of my changes? or what other things can I check?


You must log in to answer this question.

Browse other questions tagged .