[GH-ISSUE #944] Issue: act does not support service hostname #556

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

Originally created by @benjamin-feron on GitHub (Dec 30, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/944

When using "container" and "service" sections in jobs, host names of containers are not resolved.

System information

  • Operating System: Linux
  • Architecture: x64 (64-bit)
  • Docker version: 20.10.12
  • act version: 0.2.25

Expected behaviour

Containers host names should be resolved.

Actual behaviour

...but there are not,
for example, ping command fail with message "bad address 'host1'".

Workflow

name: Test

on: push

jobs:
  job1:
    runs-on: ubuntu-latest

    container:
      image:  alpine:latest

    services:
      host1:
        image: alpine:latest

    steps:
    - run: ping -c 1 host1

Steps to reproduce

Run the workflow above

act output

[Test/job1] 🚀  Start image=alpine:latest
[Test/job1]   🐳  docker pull image=alpine:latest platform= username= forcePull=false
[Test/job1]   🐳  docker create image=alpine:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test/job1]   🐳  docker run image=alpine:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test/job1]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[Test/job1] ⭐  Run ping -c 1 host1
[Test/job1]   🐳  docker exec cmd=[sh -e -c /home/befe/dev/github-sandbox.SUPPR/workflow/0] user= workdir=
| ping: bad address 'host1'
[Test/job1]   ❌  Failure - ping -c 1 host1
Error: exit with `FAILURE`: 1
Originally created by @benjamin-feron on GitHub (Dec 30, 2021). Original GitHub issue: https://github.com/nektos/act/issues/944 When using "container" and "service" sections in jobs, host names of containers are not resolved. ## System information - Operating System: Linux - Architecture: x64 (64-bit) - Docker version: 20.10.12 - act version: 0.2.25 ## Expected behaviour Containers host names should be resolved. ## Actual behaviour ...but there are not, for example, ping command fail with message "bad address 'host1'". ## Workflow ```yaml name: Test on: push jobs: job1: runs-on: ubuntu-latest container: image: alpine:latest services: host1: image: alpine:latest steps: - run: ping -c 1 host1 ``` </details> ## Steps to reproduce Run the workflow above ## act output ```none [Test/job1] 🚀 Start image=alpine:latest [Test/job1] 🐳 docker pull image=alpine:latest platform= username= forcePull=false [Test/job1] 🐳 docker create image=alpine:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test/job1] 🐳 docker run image=alpine:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test/job1] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir= [Test/job1] ⭐ Run ping -c 1 host1 [Test/job1] 🐳 docker exec cmd=[sh -e -c /home/befe/dev/github-sandbox.SUPPR/workflow/0] user= workdir= | ping: bad address 'host1' [Test/job1] ❌ Failure - ping -c 1 host1 Error: exit with `FAILURE`: 1 ```
kerem 2026-03-01 21:44:29 +03:00
Author
Owner

@catthehacker commented on GitHub (Dec 30, 2021):

duplicate of #173

<!-- gh-comment-id:1003094062 --> @catthehacker commented on GitHub (Dec 30, 2021): duplicate of #173
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#556
No description provided.