when a container does not specify an image, its network is forced to "host" #165

Closed
opened 2024-03-24 11:06:39 +00:00 by earl-warren · 0 comments
Owner

A test added to end-to-end reproduces the issue:

  simple-no-container:
    runs-on: docker
    services:
      pgsql:
        image: code.forgejo.org/oci/postgres:15
        env:
          POSTGRES_DB: test
          POSTGRES_PASSWORD: postgres
    steps:
    - run: |
       apt-get update -qq
       apt-get install -y -qq  postgresql-client
       PGPASSWORD=postgres psql -h pgsql -U postgres -c '\dt' test              

fails because pgsql is not a known host. The runner log shows the container running the job is bound to the "host" network while the container running the server is bound to a network created for the occasion, as specified in the configuration file of the runner.

A test [added to end-to-end](https://code.forgejo.org/forgejo/end-to-end/src/commit/d69a12b4afc0f79e020b879c194788ded1315f21/actions/example-service/.forgejo/workflows/test.yml#L7-L20) reproduces the issue: ```yaml simple-no-container: runs-on: docker services: pgsql: image: code.forgejo.org/oci/postgres:15 env: POSTGRES_DB: test POSTGRES_PASSWORD: postgres steps: - run: | apt-get update -qq apt-get install -y -qq postgresql-client PGPASSWORD=postgres psql -h pgsql -U postgres -c '\dt' test ``` fails because `pgsql` is not a known host. The runner log shows the container running the job is bound to the "host" network while the container running the server is bound to a network created for the occasion, as specified in the configuration file of the runner.
earl-warren added the
Kind/Bug
Priority
Critical
labels 2024-03-24 11:06:39 +00:00
earl-warren referenced this issue from a commit 2024-03-24 11:30:10 +00:00
earl-warren referenced this issue from a commit 2024-03-24 12:02:25 +00:00
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: forgejo/runner#165
No description provided.