Closed gbrlsnchs closed 2 years ago
I struggle with the same problem, my motivation to combine these services into one docker-compose
is to simplify local testing.
As @gbrlsnchs mentioned, the DRONE_RUNNER_NETWORKS
would be very helpful.
For developing I currently solve this by adding this line to Exec
in pipeline/backend/docker/docker.go
:
e.client.NetworkConnect(ctx, "my_custom_network", proc.Name, &network.EndpointSettings{})
We could add it as you two wrote by some env variable like: `WOODPECKER_DOCKER_NETWORKS
to the agent.
For developing I currently solve this by adding this line to
Exec
inpipeline/backend/docker/docker.go
:e.client.NetworkConnect(ctx, "my_custom_network", proc.Name, &network.EndpointSettings{})
Would that inject the network name to runners as well? Thanks!
edit: Thanks, it worked, I had to add it before return.
Clear and concise description of the problem
Currently, I'm trying to make Woodpecker work with Gitea, both locally, using Docker Compose.
I've set both server and agent, along with Gitea, to use a custom Docker network under the 10.0.0.0/8 subnet.
The issue lies when running a pipeline: containers from pipelines can't reach that custom network, so they fail when trying to clone the repository from Gitea.
Suggested solution
In Drone CI, it is possible to set
DRONE_RUNNER_NETWORKS
, so pipelines are able to use custom networks. Woodpecker CI could add an environment variable for that as well.Alternative
N/A
Additional context
Docs for
DRONE_RUNNER_NETWORKS
: https://docs.drone.io/runner/docker/configuration/reference/drone-runner-networks/ Thedocker-compose.yml
file for running Gitea and Woodpecker locally: https://codeberg.org/gbrlsnchs/void-pkgs/src/branch/trunk/docker-compose.ymlValidations