title: Is testing in Gitlab Ci supported with Opensearch docker images as a service?
body: <p>I have a Java app that is running integration tests with Elasticsearch in Gitlab.</p>
  <p>.gitlab-ci.yml:</p>
  <pre><code>...
  
  integration:
    stage: integration
    tags:
      - onprem
    services:
      - name: &quot;docker.elastic.co/elasticsearch/elasticsearch:7.10.1&quot;
        alias: &quot;elasticsearch&quot;
        command: [ &quot;bin/elasticsearch&quot;, &quot;-Expack.security.enabled=false&quot;, &quot;-Ediscovery.type=single-node&quot; ]
    script:
      - curl &quot;http://elasticsearch:9200/_cat/health&quot;
      - mvn -Dgroups=&quot;IntegrationTest&quot; -DargLine=&quot;-Durl=elasticsearch&quot; test
  
  ...
  </code></pre>
  <p>Now I want to use Opensearch 1.1.0 because that is what we use on AWS. I tried working off the docker compose setup that Opensearch suggests for developers ( <a href="https://opensearch.org/docs/latest/opensearch/install/docker/#sample-docker-compose-file-for-development" rel="nofollow noreferrer">https://opensearch.org/docs/latest/opensearch/install/docker/#sample-docker-compose-file-for-development</a> ), and came up with this:</p>
  <pre><code>...
  
  integration:
    stage: integration
    tags:
      - onprem
    services:
      - name: &quot;opensearchproject/opensearch:1.1.0&quot;
        alias: &quot;elasticsearch&quot;
        command: [
            &quot;./opensearch-docker-entrypoint.sh&quot;,
            &quot;-Ecluster.name=opensearch-cluster&quot;,
            &quot;-Enode.name=opensearch-node1&quot;,
            &quot;-Ebootstrap.memory_lock=true&quot;,
            &quot;-Ediscovery.type=single-node&quot;,
            &quot;OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m&quot;,
            &quot;DISABLE_INSTALL_DEMO_CONFIG=true&quot;,
            &quot;DISABLE_SECURITY_PLUGIN=true&quot;
        ]
    script:
      - curl &quot;http://elasticsearch:9200/_cat/health&quot;
      - mvn -Dgroups=&quot;IntegrationTest&quot; -DargLine=&quot;-Durl=elasticsearch&quot; test
  
  ...
  </code></pre>
  <p>The curl response:</p>
  <pre><code>$ curl &quot;http://elasticsearch:9200/_cat/health&quot;
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0curl: (7) Failed to connect to elasticsearch port 9200: No route to host
  </code></pre>
  <p>One big difference seems to be that Elasticsearch disables security with an environment variable, but Opensearch does that with an argument through setup. I tried running Opensearch directly through the &quot;bin/&quot; directory, but that seems to give all sorts of additional errors. The Opensearch image is available on dockerhub ( <a href="https://hub.docker.com/layers/opensearchproject/opensearch/1.1.0/images/sha256-94254d215845723e73829f34cf7053ae9810db360cf73c954737a717e9cf031d?context=explore" rel="nofollow noreferrer">https://hub.docker.com/layers/opensearchproject/opensearch/1.1.0/images/sha256-94254d215845723e73829f34cf7053ae9810db360cf73c954737a717e9cf031d?context=explore</a> ) , but I have no access to the Dockerfile of the Elasticsearch image to compare.</p>
  <p>I have numerous other failed setups: Tried moving different combinations of the arguments over as stage variables in gitlab-ci.</p>
  <p>Am I misunderstanding what to do here, or is what I'm trying even supported at all?</p>