I’m experimenting with a self-hosted CI/CD setup where each pipeline step runs as a Docker container. However, some steps need to build and push their own Docker images I currently use Docker-in-Docker (dind), but I keep seeing mixed opinions about it.
My setup:
services:
docker:
image: docker:dind
privileged: true
It works, but sometimes I get caching issues and network instability between inner and outer daemons.
What's the recommended and most stable approach for this — using docker:dind or mounting the host socket (/var/run/docker.sock)? What's the recommended approach for modern CI tools like GitLab CI or Jenkins agents?