Drone issues in docker swarm stack

  1. docker stack in swarm mode doesn’t support the depend_on keyword.

If drone-agent starts in front of drone-server(almost most of the time), drone-agent will trigger a dns error.

solve:

I have to start drone-server first and then start drone-agent

  1. grpc fails with docker swarm virtual ip

First, I succeed to run drone-server, and drone-agent.
Then, I push code to trigger a build, everything works well.
Last, six hours later, I push code to trigger another build, this build will always pending.

solve:

I have to start drone-server first, and get its real IP. Then let drone-agent connects to drone-server with drone-server’s real ip, not the hostname which points to a virtual ip.

To avoid the hack of getting the real IP for the server, you can use:

deploy:
  endpoint_mode: dnsrr

which seems to solve the “pending” problem. See:

for further info.

Thanks for your solution, it makes my life easy ~