Hi, I have a Gitea and drone setup running on my localhost. When drone launches an agent to run the build, the agent is put on a different Docker network to the Gitea instance so I get the error:
fatal: unable to access 'http://gitea:3000/<username>/<some repo>/': Could not resolve host: gitea
In my docker-compose.yml I have two docker networks: gitea_net
and gitea_drone
. Gitea is connected to both with Gitea’s database running only on gitea_net
. The Drone instance is only connected to gitea_drone
.
Is there a way to tell Drone to stick agents on gitea_drone
?
Note: I would love for this to all run internally via docker as I don’t have the means to setup a static IP or custom DNS server on my network.
Compose file:
version: '2'
services:
gitea:
image: gitea/gitea
restart: always
networks:
gitea_net:
gitea_drone:
volumes:
- /srv/gitea/data:/data
ports:
- "3000:3000"
- "2223:22"
depends_on:
- db
environment:
- SSH_PORT=2223
- SSH_LISTEN_PORT=22
- ROOT_URL=http://gitea:3000
db:
image: mariadb:10
restart: always
networks:
gitea_net:
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD=gitea
volumes:
- /srv/gitea/db:/var/lib/mysql
drone:
image: drone/drone:1.0.0-rc.5
restart: always
depends_on:
- gitea
networks:
gitea_drone:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /srv/gitea/drone:/data
environment:
- DRONE_GITEA_SERVER=http://gitea:3000
- DRONE_GIT_ALWAYS_AUTH=false
- DRONE_RUNNER_CAPACITY=2
- DRONE_SERVER_HOST=drone
- DRONE_SERVER_PROTO=http
- DRONE_TLS_AUTOCERT=false
ports:
- "3001:80"
- "3002:443"
networks:
gitea_net:
gitea_drone:
test pipline:
kind: pipeline
name: default
steps:
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: API_KEY
base_url: http://web:3000
files: test.txt
when:
event: tag