Compare commits
15 Commits
1.1.0+6.2.
...
feat/dind
| Author | SHA1 | Date | |
|---|---|---|---|
| b28775251b | |||
| 603689dda3 | |||
| 3f83ff31f9 | |||
| 7f9bcb1db5 | |||
| 2a1a868d4d | |||
| 12ec4fa67b | |||
| f037bdf1ac | |||
| e55970f177 | |||
| 69d1559139 | |||
| 5d8674d584 | |||
| cd33c2adfe | |||
| 22a29bb4cc | |||
| 26528162e3 | |||
| 14dd509115 | |||
| 21b6c17a69 |
@ -1,5 +1,8 @@
|
||||
RECIPE=forgejo-runner
|
||||
|
||||
# The level of logging, can be trace, debug, info, warn, error, fatal
|
||||
LOG_LEVEL=info
|
||||
|
||||
CACHE_ENABLED=false
|
||||
|
||||
# Defines the number of concrurrent tasks to be run
|
||||
@ -7,6 +10,5 @@ RUNNER_CAPACITY=1
|
||||
|
||||
RUNNER_TIMEOUT=3h
|
||||
|
||||
# Set to 'host', to use the host network. When left empty it creates a temporary
|
||||
# network for each container.
|
||||
#CONTAIER_NETWORK
|
||||
# Set to 'host', to use the host network or any other. By using 'default', the runner gets configured to use the internal network of its own stack, so the action can access the docker
|
||||
#CONTAINER_NETWORK=default
|
||||
|
||||
17
README.md
17
README.md
@ -19,22 +19,23 @@ To enable [caching](https://forgejo.org/docs/latest/admin/runner-installation/#c
|
||||
CACHE_ENABLED=true
|
||||
```
|
||||
|
||||
## Docker in Docker
|
||||
## Docker in Docker (in Docker)
|
||||
|
||||
To give an action container the ability to create more docker containers (e.g. for tests) you need to set the container network to "host". This can be done in the `.env` file:
|
||||
```
|
||||
CONTAINER_NETWORK=host
|
||||
```
|
||||
Per default, the action container has the ability to access the docker socket of the host machine via the socket proxy in this recipe. Keep this in mind, since this is a security concern!
|
||||
|
||||
This allows you to access the docker host at "tcp://0.0.0.0:2375". See this part of an action workflow on how to access the docker host.
|
||||
If you don't set anything in the `CONTAINER_NETWORK` env, the runner is configured to their own dedicated network and so can't reach the docker socket proxy.
|
||||
|
||||
If you set `CONTAINER_NETWORK` to `default`, the runner attaches the started containers to the internal network of this recipe, so the socket proxy can be reached (via it's dns name).
|
||||
|
||||
This allows you to access the docker host at "tcp://socket-proxy:2375". See this part of an action workflow on how to access the docker host.
|
||||
```
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
endpoint: tcp://0.0.0.0:2375
|
||||
endpoint: tcp://socket-proxy:2375
|
||||
platforms: linux/amd64
|
||||
- name: run api tests
|
||||
run: |
|
||||
export DOCKER_HOST="tcp://0.0.0.0:2375"
|
||||
export DOCKER_HOST="tcp://socket-proxy:2375"
|
||||
make test-api
|
||||
```
|
||||
|
||||
2
abra.sh
2
abra.sh
@ -1,4 +1,4 @@
|
||||
export RUNNER_CONF_VERSION=v8
|
||||
export RUNNER_CONF_VERSION=v9
|
||||
export ENTRYPOINT_VERSION=v9
|
||||
|
||||
register_runner() {
|
||||
|
||||
11
compose.yml
11
compose.yml
@ -2,10 +2,9 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: 'code.forgejo.org/forgejo/runner:6.2.2'
|
||||
image: 'code.forgejo.org/forgejo/runner:12.3.0'
|
||||
environment:
|
||||
- DOCKER_HOST=tcp://socket-proxy:2375
|
||||
- RUNNER_CAPACITY
|
||||
configs:
|
||||
- source: runner_conf
|
||||
target: /config.yml
|
||||
@ -16,7 +15,7 @@ services:
|
||||
- "data:/data"
|
||||
deploy:
|
||||
labels:
|
||||
- "coop-cloud.${STACK_NAME}.version=1.1.0+6.2.2"
|
||||
- "coop-cloud.${STACK_NAME}.version=4.1.1+12.3.0"
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
@ -24,8 +23,9 @@ services:
|
||||
entrypoint: /custom-entrypoint.sh
|
||||
|
||||
socket-proxy:
|
||||
image: lscr.io/linuxserver/socket-proxy:1.26.1-r0-ls15
|
||||
image: lscr.io/linuxserver/socket-proxy:3.2.10
|
||||
environment:
|
||||
- PROXY_READ_TIMEOUT=5000
|
||||
- ALLOW_START=1
|
||||
- ALLOW_STOP=1
|
||||
- ALLOW_RESTARTS=1
|
||||
@ -57,14 +57,13 @@ services:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- "2375:2375"
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
networks:
|
||||
internal:
|
||||
attachable: true
|
||||
|
||||
configs:
|
||||
runner_conf:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
log:
|
||||
# The level of logging, can be trace, debug, info, warn, error, fatal
|
||||
level: info
|
||||
level: {{ env "LOG_LEVEL" }}
|
||||
|
||||
runner:
|
||||
# Where to store the registration result.
|
||||
@ -48,12 +48,12 @@ container:
|
||||
# Specifies the network to which the container will connect.
|
||||
# Could be host, bridge or the name of a custom network.
|
||||
# If it's empty, create a network automatically.
|
||||
network: "{{ env "CONTAINER_NETWORK" }}"
|
||||
network: {{ if eq (env "CONTAINER_NETWORK") "default" }}{{ env "STACK_NAME" }}_internal{{ else }}{{ env "CONTAINER_NETWORK" }}{{ end }}
|
||||
# Whether to create networks with IPv6 enabled. Requires the Docker daemon to be set up accordingly.
|
||||
# Only takes effect if "network" is set to "".
|
||||
enable_ipv6: false
|
||||
# Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker).
|
||||
privileged: false
|
||||
privileged: true
|
||||
# And other options to be used when the container is started (eg, --add-host=my.forgejo.url:host-gateway).
|
||||
options:
|
||||
# The parent directory of a job's working directory.
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
set -e
|
||||
|
||||
mkdir -p /data
|
||||
touch /data/.runner
|
||||
mkdir -p /data/.cache
|
||||
|
||||
# Wait for the runner to get registered before starting the forgejo-runner daemon.
|
||||
|
||||
1
release/3.0.0+11.1.2
Normal file
1
release/3.0.0+11.1.2
Normal file
@ -0,0 +1 @@
|
||||
Fixed a typo in .env.sample and upgrade runner to v11
|
||||
1
release/4.0.0+12.0.1
Normal file
1
release/4.0.0+12.0.1
Normal file
@ -0,0 +1 @@
|
||||
The breaking change in forgejo-runner should not affect us. Making a major bump just in case
|
||||
1
release/4.1.1+12.3.0
Normal file
1
release/4.1.1+12.3.0
Normal file
@ -0,0 +1 @@
|
||||
Security: Remove Docker Socket binding + Chore: update to 12.3.0
|
||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user