Docker-in-docker build failing with :latest (19.03) because of port mismatch
Summary
The docker-in-docker build fails because of port mismatch when using docker:latest and docker:dind images (see details under).
Reversing images to use docker:18.09.8 and docker:18.09.8-dind results in stable build.
I'm not sure if it's a problem with gitlab, that needs to meet adaptations to newest docker version, or recommend not using latest tag, or a bug introduced in newest docker image.
Steps to reproduce
Execute docker-in-docker build with :latest
Configuration used
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
docker-build:
stage: build
image: docker:latest
script:
- docker build --pull --no-cache -t karaf-container .
Current behavior
The docker-dind starts (after reporting timeout) on port 2376, while the docker-in-docker service expects the service on port 2375
Expected behavior
The ports should match
Versions
latest
Relevant logs
(Please provide any relevate log snippets you have collected, using code blocks (```) to format)
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image docker:dind ID=sha256:6ce0d31cf4d670f84b0f74b1b15910f9e3fde4105232e14b0d360a6a49c05362 for docker service...
Waiting for services to be up and running...
*** WARNING: Service runner-84dee5f9-project-239-concurrent-0-docker-0 probably didn't start properly.
service runner-84dee5f9-project-239-concurrent-0-docker-0-wait-for-service did timeout
....
2019-07-23T08:00:36.945478758Z time="2019-07-23T08:00:36.945262427Z" level=info msg="Loading containers: done."
2019-07-23T08:00:37.296891297Z time="2019-07-23T08:00:37.296630616Z" level=info msg="Docker daemon" commit=aeac9490dc graphdriver(s)=overlay2 version=19.03.0
2019-07-23T08:00:37.296920179Z time="2019-07-23T08:00:37.296829048Z" level=info msg="Daemon has completed initialization"
2019-07-23T08:00:37.620254128Z time="2019-07-23T08:00:37.620010341Z" level=info msg="API listen on [::]:2376"
2019-07-23T08:00:37.620563610Z time="2019-07-23T08:00:37.620361177Z" level=info msg="API listen on /var/run/docker.sock"
...
$ docker build --pull --no-cache -t karaf-container .
Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?