Skip to content

Trouble with action when using within docker container - Solved? #226

@Suween

Description

@Suween

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions