GitLab CI Docker-in-Docker Error: Cannot connect to the Docker daemon at tcp://docker:2375
Modern `docker:dind` enables TLS on port 2376 by default when `DOCKER_TLS_CERTDIR` is set.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: GitLab CI Docker-in-Docker Error
Platform: CI/CD
Common Root Causes:
- Modern `docker:dind` enables TLS on port 2376 by default when `DOCKER_TLS_CERTDIR` is set.
Interactive Diagnostic Checklist
Verified Solutions:
- Set `DOCKER_TLS_CERTDIR: "/certs"` consistently across job and dind service, or use Kaniko/Buildah.
Safe Diagnostic Command:
env | grep DOCKER_
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
Modern `docker:dind` enables TLS on port 2376 by default when `DOCKER_TLS_CERTDIR` is set. Recommended diagnostic: `env | grep DOCKER_`. Remediation: Set `DOCKER_TLS_CERTDIR: "/certs"` consistently across job and dind service, or use Kaniko/Buildah.
Worked Examples
- Run `env | grep DOCKER_` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-gitlab-ci-dind-tls-cert-error · Independently verified: 2026-11-25