title: Using ELK Stack in Docker with docker-compose with x.pack auth failed to authenticate the user
body: <p>I want to use the elk stack with docker.</p>
  
  <p>for this i created a docker-compose file. 
  Everything works fine as long as I have X-Pack deactivated.</p>
  
  <p>But now I want to have a login in the kibana UI and therefore i want to use the x-pack</p>
  
  <p>I defined the UserName and Passsword in the environment of the elasticsearch and also logstash.</p>
  
  <p>But i always get this exceptionm</p>
  
  <blockquote>
    <p>elasticsearch_1  | [2017-11-27T09:25:58,190][INFO
    ][o.e.x.s.a.AuthenticationService] [clEpqom] Authentication of
    [elastic] was terminated by realm [reserved] - failed to authenticate
    user [elastic]</p>
  </blockquote>
  
  <p>Any hints of what i'm doing wrong?
  Here my docker-compose file:</p>
  
  <pre><code>version: '2'
  
  services:
    elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch-platinum:6.0.0
      ports:
        - "9200:9200"
        - "9300:9300"
      environment:
        ELASTIC_USERNAME: "elastic"
        ELASTIC_PASSWORD: "MyPw123"
        http.cors.enabled: "true"
        http.cors.allow-origin: "*"
      networks:
        - elk
  
    logstash:
      image: docker.elastic.co/logstash/logstash:6.0.0
      environment:
        xpack.monitoring.elasticsearch.url: "172.17.0.1:9200"
        xpack.monitoring.elasticsearch.username: "elastic"
        xpack.monitoring.elasticsearch.password: "MyPw123"
      networks:
        - elk
      depends_on:
        - elasticsearch
  
    kibana:
      image: docker.elastic.co/kibana/kibana:6.0.0
      ports:
        - "5601:5601"
      networks:
        - elk
      depends_on:
        - elasticsearch
  networks:
    elk:
      driver: bridge
  </code></pre>
  
  <p><strong>UPDATE</strong>
  Using the default password "changeme" does work.</p>