[GH-ISSUE #835] Question: Step container network mode #508

Closed
opened 2026-03-01 21:44:03 +03:00 by kerem · 1 comment
Owner

Originally created by @Jacob-Morgan on GitHub (Oct 6, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/835

Originally assigned to: @catthehacker on GitHub.

I have a GitHub workflow which launches a container to execute the build process this in turn launches a docker-compose stack for integration test which talks back to the build container for endpoint mocking. While this works locally and in Github, when attempting to run the workflow locally using ACT it fails. The failure is caused by a change made in #141 where-by it starts a step container in network isolation mode sharing the same network namespace as the ACT container used to launch the build container. This in turn then prevents the build container from joining the network created by the launch of the docker-compose stack.

I've managed to verify that relaxing the network mode back to 'default' (github.com/pharos/act@6f9a94dd07) resolves the problem. However I struggling to understand the original intent of #141 by forcing newly launched containers into such a restrictive network mode, as this is very different form GitHub.

The following workflow and action where used to verify the networking information for the build container is blank and the NetworkMode is 'container:' when launched by Act, but is populated when run by Github.

Workflow
name: CI
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Docker pull
        run: docker pull docker:latest

      - name: Docker Inspect
        uses: ./.github/actions/docker-inspect
name: Docker Inspect
runs:
  using: docker
  image: docker://docker:latest
  args:
    - "sh"
    - "-c"
    - >-
        cat /proc/self/cgroup  &&
        docker inspect $(cat /proc/self/cgroup | grep 'docker' | sed 's/^.*\///' | tail -n1)
  • NOTE: For GitHub replace docker with actions_job.
Originally created by @Jacob-Morgan on GitHub (Oct 6, 2021). Original GitHub issue: https://github.com/nektos/act/issues/835 Originally assigned to: @catthehacker on GitHub. I have a GitHub workflow which launches a container to execute the build process this in turn launches a docker-compose stack for integration test which talks back to the build container for endpoint mocking. While this works locally and in Github, when attempting to run the workflow locally using ACT it fails. The failure is caused by a change made in #141 where-by it starts a step container in network isolation mode sharing the same network namespace as the ACT container used to launch the build container. This in turn then prevents the build container from joining the network created by the launch of the docker-compose stack. I've managed to verify that relaxing the network mode back to 'default' (https://github.com/pharos/act/commit/6f9a94dd078a802d93ae09645300ab4a3dd746e1) resolves the problem. However I struggling to understand the original intent of #141 by forcing newly launched containers into such a restrictive network mode, as this is very different form GitHub. The following workflow and action where used to verify the networking information for the build container is blank and the NetworkMode is 'container:<container-id>' when launched by Act, but is populated when run by Github. <details> <summary>Workflow</summary> ``` name: CI on: push: branches: [ main ] pull_request: branches: [ main ] workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Docker pull run: docker pull docker:latest - name: Docker Inspect uses: ./.github/actions/docker-inspect ``` ``` name: Docker Inspect runs: using: docker image: docker://docker:latest args: - "sh" - "-c" - >- cat /proc/self/cgroup && docker inspect $(cat /proc/self/cgroup | grep 'docker' | sed 's/^.*\///' | tail -n1) ``` * NOTE: For GitHub replace `docker` with `actions_job`. </details>
kerem 2026-03-01 21:44:03 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 7, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:962526864 --> @github-actions[bot] commented on GitHub (Nov 7, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#508
No description provided.