Cant connect to overlay network?

One of my build step relies on an a service that is running on a separated server, and they are running on the same network in swarm mode (both as manager)

docker-compose.yml

version: '3.5'

services:

  drone-server:
    image: drone/drone:alpine
    networks:
      - drone-network
    volumes:
      - .drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=${DRONE_HOST}
      - DRONE_BITBUCKET=true
      - DRONE_BITBUCKET_CLIENT=${DRONE_BITBUCKET_CLIENT}
      - DRONE_BITBUCKET_SECRET=${DRONE_BITBUCKET_SECRET}
      - DRONE_SECRET=${DRONE_SECRET}
      - DRONE_ADMIN=${DRONE_ADMIN}

  drone-agent:
    image: drone/agent
    command: agent
    restart: always
    networks:
      - drone-network
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=${DRONE_SECRET}

networks:
  drone-network:
    driver: overlay
    attachable: true
    name: drone-network

and this is my .drone.yml file

pipeline:

  build:
    image: node:9-alpine
    networks: // is it supported? i cant find documentation on this one
      - drone-network 
    commands:
      - npm run build

i need this pipeline to be able to see my services that are being exposed on the drone-network however this is not working… am i doing something wrong? or drone doesnt support yet overlay networks?

I use minio in a different network and define DRONE_NETWORK in the server config so steps in pipelines will join that docker network too, not sure if this will work in swarm mode.

drone-server:

environment:
  - DRONE_OPEN=false
  - DRONE_HOST=http://{host}
  - DRONE_GITLAB=true
  - DRONE_NETWORK=minio

docker-compose networks

networks:
  minio:
    external: true
1 Like

thanks!!! this did work! i have missed this env var out. :+1: yet trying to find this on the documentation… and i cant find where it is mentioned…

I think is not documented AFAIK can’t find anything either. Old docs have an Installation Reference but out of date.