-
I try to do this like:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @SimFG - Thanks for your question. Can you please confirm if the github actions job you are running that unable to connect to the etcd service container is also itself running in a container? This would be denoted by something like jobs:
# Label of the container job
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: node:16-bullseye If so, the etcd service container you are spinning up will not be available on
If this doesn't address the issue please provide your actions workflow yaml file, redacted if required. |
Beta Was this translation helpful? Give feedback.
-
@jmhbnz thanks your reply. The following is the entire workflow file. Mysql can serve normally, but etcd can’t. It seems that some configuration is missing. jobs:
build:
name: Unittest AMD64 Ubuntu ${{ matrix.ubuntu }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ubuntu: [18.04]
env:
UBUNTU: ${{ matrix.ubuntu }}
services:
mysql:
image: mysql:5.7.42
env:
MYSQL_ROOT_PASSWORD: xxxx
MYSQL_DATABASE: xxxx
ports:
- 3306:3306
etcd:
image: quay.io/coreos/etcd:v3.5.5
ports:
- 2379:2379
steps:
- uses: actions/checkout@v3
- name: Run Unittest
run: make test-go |
Beta Was this translation helpful? Give feedback.
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 onhttp://0.0.0.0:2379
inside the container.This is easy enough to do as follows: