github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Trouble with action when using within docker container - Solved?

Open Suween opened this issue 1 month ago • 1 comments

Hello, Given:

jobs:
  tests:
    timeout-minutes: 30
    runs-on: ubuntu-latest

    container: 
      image: ghcr.io/some-image:latest
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Tailscale
      timeout-minutes: 5
      uses: tailscale/github-action@v4
      with:
        oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
        oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
        tags: tag:test-bench

We get this error in a CI: Error: tailscaled daemon did not become ready within timeout, last error: tailscale failed with exit code 1

Digging, I realized the action try to start the application via systemctl? Or at least when I tried used v3 (which gave me the hint). Which does not work on 'default' docker images.

So - I saw somewhere to add options: --privileged as such

    container: 
      image: ghcr.io/some-image:latest
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
      options: --privileged

Now it works!

My issue is there was no doc I found explaining this issue - even the Tailscail AI was of no use. So I guess my issue is can you document this somewhere?

Please enlighten me if the documentation is somewhere or if there's a better solution.

Thanks

Suween avatar Nov 06 '25 21:11 Suween