# Docker networks are not cleaned after an action has ruined

**URL:** <https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352>\
**Category:** Actions\
**Created:** [May 30, 2023, 7:37pm UTC](https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352 "2023-05-30T19:37:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reinos\_nl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/reinos_nl/32/5245_2.png) [@reinos\_nl](https://forum.gitea.com/u/reinos_nl)\
**Post date:** [May 30, 2023, 7:37pm UTC](https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352/1 "2023-05-30T19:37:19Z")

</div>

It seems that the docker networks for the actions are not cleaned. After a while I get this error from the runner

```auto
Error response from daemon: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

```

Checking the networks on the runner it seems growing

```auto
IPv4 address for br-0577fa4b1190: 192.168.208.1
  IPv4 address for br-0c3862391fab: 172.25.0.1
  IPv4 address for br-145a1aecbadd: 192.168.192.1
  IPv4 address for br-3801964bb427: 172.29.0.1
  IPv4 address for br-3807d7c3b4c5: 192.168.224.1
  IPv4 address for br-3e0eff041f50: 172.23.0.1
  IPv4 address for br-443cbfadafb0: 192.168.128.1
  IPv4 address for br-4539edea2bd8: 192.168.32.1
  IPv4 address for br-4ee75151194c: 172.30.0.1
  IPv4 address for br-5200112b60b3: 172.26.0.1
  IPv4 address for br-5475ea3ff854: 172.21.0.1
  IPv4 address for br-55b8bb49ff55: 192.168.80.1
  IPv4 address for br-587854069e90: 192.168.240.1
  IPv4 address for br-595d84d8110a: 172.18.0.1
  IPv4 address for br-700118ab19d1: 172.20.0.1
  IPv4 address for br-7086efb55d31: 172.22.0.1
  IPv4 address for br-7efdbee3a6ff: 172.27.0.1
  IPv4 address for br-9108ab3f168c: 192.168.48.1
  IPv4 address for br-a07bddd0a967: 192.168.160.1
  IPv4 address for br-a84b412cbd8d: 192.168.112.1
  IPv4 address for br-ab589f2ca475: 172.24.0.1
  IPv4 address for br-b06646b350f3: 192.168.64.1
  IPv4 address for br-b95ecb29923a: 172.28.0.1
  IPv4 address for br-cdd17d910441: 192.168.144.1
  IPv4 address for br-d50c8007e699: 192.168.176.1
  IPv4 address for br-d8f2e74b7a82: 172.19.0.1
  IPv4 address for br-e827a4d58e64: 192.168.96.1
  IPv4 address for br-e86aa9ab6347: 192.168.0.1
  IPv4 address for br-f3f12887cf4b: 172.31.0.1
  IPv4 address for docker0: 172.17.0.1
  IPv4 address for eno1: 192.168.20.203

```

After running `docker network prune` it removed all the actions container networks

```auto
~$ sudo docker network prune
WARNING! This will remove all custom networks not used by at least one container.
Are you sure you want to continue? [y/N] y
Deleted Networks:
GITEA-ACTIONS-TASK-89_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-86_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-104_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-106_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-105_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-99_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-94_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-92_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-84_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-96_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-91_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-107_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-82_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-93_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-88_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-83_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-101_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-108_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-102_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-103_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-97_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-90_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-81_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-87_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-95_WORKFLOW-Deployment-to-DO_JOB-Build-network
GITEA-ACTIONS-TASK-98_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-85_WORKFLOW-Release_JOB-Build-network
GITEA-ACTIONS-TASK-100_WORKFLOW-Release_JOB-Build-network

```

Re-running the actions is now working without the docker error.

Is this a known issue, or did I miss some configuration?

Running Gitea: 1.19.3

---

<div class="post-metadata">

**Author:** ![sillygudong](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/sillygudong/32/3515_2.png) [@sillygudong](https://forum.gitea.com/u/sillygudong)\
**Post date:** [May 31, 2023, 8:33am UTC](https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352/2 "2023-05-31T08:33:46Z")

</div>

Are you start runner with docker image? and what’s the version of your runner?

---

<div class="post-metadata">

**Author:** ![reinos\_nl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/reinos_nl/32/5245_2.png) [@reinos\_nl](https://forum.gitea.com/u/reinos_nl)\
**Post date:** [May 31, 2023, 10:06am UTC](https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352/3 "2023-05-31T10:06:37Z")

</div>

Yes, the runner is in a docker container with version 0.1.8 of the runner.

My docker-compose is looking like this

```auto
version: "3"

services:
  gitea_runner:
    image: gitea/act_runner:0.1.8
    container_name: gitea_runner
    restart: always
    volumes:
      - ./data/act_runner:/data
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - GITEA_INSTANCE_URL=http://gitea.local
      - GITEA_RUNNER_REGISTRATION_TOKEN=Div7z6Z1DNFUQgSuGasp1IAr4ldHcQXlaCp2eYKP

```

---

<div class="post-metadata">

**Author:** ![sillygudong](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/sillygudong/32/3515_2.png) [@sillygudong](https://forum.gitea.com/u/sillygudong)\
**Post date:** [May 31, 2023, 10:27am UTC](https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352/4 "2023-05-31T10:27:50Z")

</div>

Could you try with the image of `gitea/act_runner:nightly`? I made some improvements to the network.  
Here are related PRs:

- [#184 - Add configuration item of `container.network` - act\_runner - Gitea: Git with a cup of tea](https://gitea.com/gitea/act_runner/pulls/184)
- [#56 - Fix container network issue - act - Gitea: Git with a cup of tea](https://gitea.com/gitea/act/pulls/56)

If the network is still not deleted, feel free to reply.

---

<div class="post-metadata">

**Author:** ![reinos\_nl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/reinos_nl/32/5245_2.png) [@reinos\_nl](https://forum.gitea.com/u/reinos_nl)\
**Post date:** [June 1, 2023, 6:48am UTC](https://forum.gitea.com/t/docker-networks-are-not-cleaned-after-an-action-has-ruined/7352/5 "2023-06-01T06:48:18Z")

</div>

Thanks for the update. Installed/updated and I’ll keep an eye onto this.
