drone-plugins/drone-docker

Docker 18.09.01 and higher issue

bradrydzewski opened this issue · 4 comments

Docker changed the docker:dind image to use the TCP port instead of the unix socket and as a result sets the default DOCKER_HOST environment variable. A number of changes to the /usr/local/bin/dockerd-entrypoint.sh have potential to break this plugin. So we cannot upgrade the Docker version until we have modified the plugin accordingly and performed significant testing.

I would like to take a look at this, our docker:dind image begins to be a bit old now.
Also, my team builds fails very often (and randomly) in this part: (might be the related)

+ /usr/local/bin/dockerd --data-root /var/lib/docker
+ /usr/local/bin/docker version
Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:46:51 2018
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
time="2020-01-31T09:23:39Z" level=fatal msg="exit status 1"

EDIT:
I have activated docker daemon debug mode to check the error, to be sure it's related or not. Waiting for a failure

@bradrydzewski I managed to get everything working, just 2 questions so I can cleanup everything:

  • We really need to enable TLS inside a docker container ?
  • You prefer to expose API via unix socket, tcp socket or both ?

The available flags for the daemon should be configurable so far while it should use similar defaults looks today.

As commented in #262 I'm not seeing anything in the docker*-entrypoint.sh code that's even run in our use case, so I'm running a version that removes that part of the entrypoint. It's working for my use cases. I also pushed it up to my personal docker hub repo if someone wants to try it out without building it locally:

https://hub.docker.com/r/sudobmitch/drone-docker/

If you'd like my branch submitted as a separate PR, let me know.