Skip to content

How to get a etcd service in the github workflow #16504

Answered by jmhbnz
SimFG asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the full example. I can see the issue now.

By default, etcd listens on http://localhost:2379. However if we are trying to access the etcd instance from outside a docker container, we need to ensure it listens on http://0.0.0.0:2379 inside the container.

This is easy enough to do as follows:

jobs:
  build:
    name: Test
    runs-on: ubuntu-latest
    timeout-minutes: 30
    services:
      etcd:
        image: quay.io/coreos/etcd:v3.5.5
        env:
          - ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
          - ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
        ports:
          - 2379:2379
    steps:
      - uses: actions/checkout@v3
      - name: Run test
        run: |

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jmhbnz
Comment options

Answer selected by SimFG
@SimFG
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants