Hello! I’d like to continue.
https://github.com/drone/drone/issues/2281
So, i am massively misunderstanding, maybe.
We’ve got:
1 drone server
2 drone agents
1 host
Lets take a look at http://docs.drone.io/installation/
version: '2'
services:
drone-server:
image: drone/drone:0.8
ports:
- 80:8000
- 9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment:
- DRONE_OPEN=true
- DRONE_HOST=${DRONE_HOST}
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
drone-agent:
image: drone/agent:0.8
command: agent
restart: always
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=drone-server:9000
- DRONE_SECRET=${DRONE_SECRET}
You’re telling me, that DRONE_SERVER env var will change port agent is listening on.
I can’t see how.
Atm i’ve got one server and two agents on single host, agent’s are both listening to port 3000, it’s being port_mapped to random port on host. Everything is working, but clearly it’s not best practice, since agent doesn’t know port_mapped port, and there are errors in logs:
Dec 14 14:21:31 frankenci logz server frankenci ci0[1530]: INFO: 2017/12/14 14:21:31 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: write tcp 172.17.0.2:9000->10.132.0.2:38194: write: broken pipe"
Dec 14 14:21:41 frankenci logz server frankenci ci0[1530]: INFO: 2017/12/14 14:21:41 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: write tcp 172.17.0.2:9000->10.132.0.2:38206: write: broken pipe"
Dec 14 14:21:51 frankenci logz server frankenci ci0[1530]: INFO: 2017/12/14 14:21:51 transport: http2Server.HandleStreams failed to receive the preface from client: read tcp 172.17.0.2:9000->10.132.0.2:38220: read: connection reset by peer
Dec 14 14:22:01 frankenci logz server frankenci ci0[1530]: INFO: 2017/12/14 14:22:01 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: write tcp 172.17.0.2:9000->10.132.0.2:38234: write: broken pipe"
Dec 14 14:22:11 frankenci logz server frankenci ci0[1530]: INFO: 2017/12/14 14:22:11 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: write tcp 172.17.0.2:9000->10.132.0.2:38248: write: broken pipe"
So i’d like to set some variable to tell drone agent
to listen to different port, and start using docker hostmode for example.
Thanks a lot in advance! Hope i’m just dumb and there is solution)