# ELK Docker: Prebuild X-Pack not working

**URL:** <https://discuss.elastic.co/t/elk-docker-prebuild-x-pack-not-working/107640>\
**Category:** Elasticsearch\
**Created:** [November 14, 2017, 10:11pm UTC](https://discuss.elastic.co/t/elk-docker-prebuild-x-pack-not-working/107640 "2017-11-14T22:11:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![n0wis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n0wis/32/24215_2.png) [@n0wis](https://discuss.elastic.co/u/n0wis)\
**Post date:** [November 14, 2017, 10:11pm UTC](https://discuss.elastic.co/t/elk-docker-prebuild-x-pack-not-working/107640/1 "2017-11-14T22:11:49Z")

</div>

Hello !

i'm trying to build an Elastic Stack (alias ELK) with Docker and Docker-compose, but I'm blocking on issue with X-Pack, who's prebuild into Docker's images.

i'm using officials images:  
_docker/elk/elasticsearch/Dockerfile:_

```
FROM docker.elastic.co/elasticsearch/elasticsearch:5.6.4

```

_docker/elk/kibana/Dockerfile:_

```
FROM docker.elastic.co/kibana/kibana:5.6.4

```

_docker/elk/logstash/Dockerfile:_

```
FROM docker.elastic.co/logstash/logstash:5.6.3

```

_docker/docker-compose.dev:_

```
    version: "3.3"

    services:
      elasticsearch:
        image: elasticsearch
        ports:
          - "9200:9200"
          - "9300:9300"
        volumes:
          - ./elk/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
        environment:
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        networks:
          elk_network:
            ipv4_address: 172.10.10.101

      kibana:
        build:
          context: ./elk/kibana
          dockerfile: Dockerfile.dev
        volumes:
          - ./elk/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml
        environment:
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ports:
          - "5601:5601"
        depends_on:
          - elasticsearch
        networks:
          elk_network:
            ipv4_address: 172.10.10.102

      logstash:
        build:
          context: ./elk/logstash
          dockerfile: Dockerfile.dev
        volumes:
          - ./elk/logstash/config/:/usr/share/logstash/config/
          - ./elk/logstash/pipeline:/usr/share/logstash/pipeline
        environment:
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ports:
          - "5000:5000"
        depends_on:
          - elasticsearch
        networks:
          elk_network:
            ipv4_address: 172.10.10.103

    # DEFINE NETWORKS
    networks:
      elk_network:
        driver: bridge
        ipam:
          driver: default
          config:
          -
            subnet: 172.10.10.0/16

```

You can see that I'm using configuration files:

_docker/elk/elasticsearch/config/elasticsearch.yml:_

```
## Default Elasticsearch configuration from elasticsearch-docker.
## from https://github.com/elastic/elasticsearch-docker/blob/master/build/elasticsearch/elasticsearch.yml
#
cluster.name: "docker-cluster"
network.host: 0.0.0.0

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: 1

## Use single node discovery in order to disable production mode and avoid bootstrap checks
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
#
discovery.type: single-node

## Disable X-Pack
## see https://www.elastic.co/guide/en/x-pack/current/xpack-settings.html
## https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-enabling
#
# xpack.security.enabled: false

```

_docker/elk/kibana/config/kibana.yml:_

```
## Default Kibana configuration from kibana-docker.
## from https://github.com/elastic/kibana-docker/blob/master/build/kibana/config/kibana.yml
#
server.name: kibana
server.host: "0"
elasticsearch.url: http://elasticsearch:9200

## Disable X-Pack
## see https://www.elastic.co/guide/en/x-pack/current/xpack-settings.html
## https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-enabling
#
# xpack.security.enabled: false
# xpack.security.useDefaultEsCredentials: false

```

When I'm running Docker with this configuration, all services are running but I got an error on Kibana:

> Login is currently disabled because the license could not be determined. Please check that Elasticsearch is running, then refresh this page.

So, I'm trying to update my X-Pack free licence with this CURL:

`curl -XPUT -u elastic:changeme 'http://172.10.10.101:9200/_xpack/license&acknowledge=true' -H "Content-Type: application/json" -d @nowis-310bd8b6-c867-4e18-aec5-3f6197daec6d-v5.json`

But I got this error:

> No handler found for uri [/\_xpack/license&acknowledge=true] and method [PUT]

And then, when I enable X-pack plugin in Elasticsearch configuration, Elastic crash with this error:

> Suppressed: java.lang.IllegalArgumentException: unknown setting [xpack.watcher.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Did I forgot to do something ?

---

<div class="post-metadata">

**Author:** ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)\
**Post date:** [November 15, 2017, 2:14am UTC](https://discuss.elastic.co/t/elk-docker-prebuild-x-pack-not-working/107640/2 "2017-11-15T02:14:46Z")

</div>

For Elasticsearch you are not using `build`, but `image: elasticsearch` instead. So basically you are pulling latest from Docker Hub and those images don't have X-Pack included. I assume this should use `build` similar to your Kibana and Logstash setup.

---

<div class="post-metadata">

**Author:** ![n0wis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/n0wis/32/24215_2.png) [@n0wis](https://discuss.elastic.co/u/n0wis)\
**Post date:** [November 18, 2017, 9:37am UTC](https://discuss.elastic.co/t/elk-docker-prebuild-x-pack-not-working/107640/3 "2017-11-18T09:37:06Z")

</div>

Great ! Many thanks !

I've just update my docker-compose file:

```
...
elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.6.4
...

```

It's working 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 16, 2017, 9:37am UTC](https://discuss.elastic.co/t/elk-docker-prebuild-x-pack-not-working/107640/4 "2017-12-16T09:37:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
