Compare commits
9 Commits
3.2.0+11.3
...
5.0.0+12.3
| Author | SHA1 | Date | |
|---|---|---|---|
| e499c8e6ce | |||
| b28775251b | |||
| 603689dda3 | |||
| 3f83ff31f9 | |||
| 7f9bcb1db5 | |||
| 2a1a868d4d | |||
| 12ec4fa67b | |||
| f037bdf1ac | |||
| e55970f177 |
@ -10,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.
|
||||
#CONTAINER_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-b
|
||||
export RUNNER_CONF_VERSION=v9
|
||||
export ENTRYPOINT_VERSION=v9
|
||||
|
||||
register_runner() {
|
||||
|
||||
@ -2,7 +2,7 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: 'code.forgejo.org/forgejo/runner:11.3.1'
|
||||
image: 'code.forgejo.org/forgejo/runner:12.3.0'
|
||||
environment:
|
||||
- DOCKER_HOST=tcp://socket-proxy:2375
|
||||
configs:
|
||||
@ -15,7 +15,7 @@ services:
|
||||
- "data:/data"
|
||||
deploy:
|
||||
labels:
|
||||
- "coop-cloud.${STACK_NAME}.version=3.2.0+11.3.1"
|
||||
- "coop-cloud.${STACK_NAME}.version=5.0.0+12.3.0"
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
@ -23,7 +23,7 @@ services:
|
||||
entrypoint: /custom-entrypoint.sh
|
||||
|
||||
socket-proxy:
|
||||
image: lscr.io/linuxserver/socket-proxy:3.2.8
|
||||
image: lscr.io/linuxserver/socket-proxy:3.2.10
|
||||
environment:
|
||||
- PROXY_READ_TIMEOUT=5000
|
||||
- ALLOW_START=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:
|
||||
|
||||
@ -48,7 +48,7 @@ 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
|
||||
|
||||
@ -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/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
|
||||
1
release/5.0.0+12.3.0
Normal file
1
release/5.0.0+12.3.0
Normal file
@ -0,0 +1 @@
|
||||
implement logic to set the stacks internal network for the action containers to support dind without a host port binding
|
||||
Reference in New Issue
Block a user