I try to connect elasticsearch on Gitlab CI for running my test but always got connection refused
here my script
services: - name: docker.elastic.co/elasticsearch/elasticsearch:7.6.0 command: [ "bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node" ] script: - curl "http://$(cat /etc/hosts |grep $HOSTNAME|cut -d$'t' -f1):9200"
$(cat /etc/hosts |grep $HOSTNAME|cut -d$'t' -f1) I can get IP address
I try to use
alias: elasticsearch but when I
curl "http://elasticsearch:9200" also got error
Could not resolve host