From bf11dac84818afcbe22445e0ce2e456e9791d209 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 6 Oct 2023 16:18:09 +0200 Subject: [PATCH] examples/docker-compose: network: host is required otherwise a network will be created with no route to the forgejo instance and a checkout will fail to reach it --- examples/docker-compose/compose-demo-workflow.yml | 2 +- examples/docker-compose/compose-forgejo-and-runner.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/docker-compose/compose-demo-workflow.yml b/examples/docker-compose/compose-demo-workflow.yml index 1ce2fee..663dc53 100644 --- a/examples/docker-compose/compose-demo-workflow.yml +++ b/examples/docker-compose/compose-demo-workflow.yml @@ -19,7 +19,7 @@ services: cd /srv/demo ; git init --initial-branch=main ; mkdir -p .forgejo/workflows ; - echo "{ on: [push], jobs: { test: { runs-on: docker, steps: [ { run: echo All Good } ] } } }" > .forgejo/workflows/demo.yml ; + echo "{ on: [push], jobs: { test: { runs-on: docker, steps: [ {uses: actions/checkout@v4}, { run: echo All Good } ] } } }" > .forgejo/workflows/demo.yml ; git add . ; git config user.email root@example.com ; git config user.name username ; diff --git a/examples/docker-compose/compose-forgejo-and-runner.yml b/examples/docker-compose/compose-forgejo-and-runner.yml index 05a5110..ae432b9 100644 --- a/examples/docker-compose/compose-forgejo-and-runner.yml +++ b/examples/docker-compose/compose-forgejo-and-runner.yml @@ -62,6 +62,7 @@ services: sleep 1 ; done ; forgejo-runner generate-config > config.yml ; + sed -i -e "s|network: .*|network: host|" config.yml ; sed -i -e "s|labels: \[\]|labels: \[\"docker:docker://alpine:3.18\"\]|" config.yml ; chown -R 1000:1000 /data '