Official Repository

Last pushed: 3 days ago
Short Description
Elasticsearch is a powerful open source search and analytics engine that makes data easy to explore.
Full Description

DEPRECATED

This image has been deprecated in favor of the official elasticsearch image provided and maintained by elastic.co. The upstream images are available to pull via docker.elastic.co/elasticsearch/elasticsearch:[version] like 5.4.2. The images found here will receive no further updates once the 5.6.0 release is available upstream. Please adjust your usage accordingly.

Elastic provides open-source support for Elasticsearch via the elastic/elasticsearch GitHub repository and the Docker image via the elastic/elasticsearch-docker GitHub repository, as well as community support via its forums.

Supported tags and respective Dockerfile links

Quick reference

What is Elasticsearch?

Elasticsearch is a search server based on Lucene. It provides a distributed, multitenant-capable full-text search engine with a RESTful web interface and schema-free JSON documents.

Elasticsearch is a registered trademark of Elasticsearch BV.

wikipedia.org/wiki/Elasticsearch

How to use this image

Cluster

Note: since 5.0, Elasticsearch only listens on localhost by default on both http and transport, so this image sets http.host to 0.0.0.0 (given that localhost is not terribly useful in the Docker context).

As a result, this image does not support clustering out of the box and extra configuration must be set in order to support it.

Supporting clustering implies having Elasticsearch in a production mode which is more strict about the bootstrap checks that it performs, especially when checking the value of vm.max_map_count which is not namespaced and thus must be set to an acceptable value on the host (as opposed to simply using --sysctl on docker run).

One example of adding clustering support is to pass the configuration on the docker run:

$ docker run -d --name elas elasticsearch -Etransport.host=0.0.0.0 -Ediscovery.zen.minimum_master_nodes=1

See the following sections of the upstream documentation for more information:

This comment in elastic/elasticsearch#4978 shows why this change was added in upstream.

Elasticsearch will not start in production mode if vm.max_map_count is not high enough. [...] If the value on your system is NOT high enough, then your cluster is going to crash and burn at some stage and you will lose data.

Running Containers

You can run the default elasticsearch command simply:

$ docker run -d elasticsearch

You can also pass in additional flags to elasticsearch:

$ docker run -d elasticsearch -Des.node.name="TestNode"

This image comes with a default set of configuration files for elasticsearch, but if you want to provide your own set of configuration files, you can do so via a volume mounted at /usr/share/elasticsearch/config:

$ docker run -d -v "$PWD/config":/usr/share/elasticsearch/config elasticsearch

This image is configured with a volume at /usr/share/elasticsearch/data to hold the persisted index data. Use that path if you would like to keep the data in a mounted volume:

$ docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch

This image includes EXPOSE 9200 9300 (default http.port), so standard container linking will make it automatically available to the linked containers.

... via docker stack deploy or docker-compose

Example stack.yml for elasticsearch:

version: '3.1'

services:

    elasticsearch:
        image: elasticsearch

    kibana:
        image: kibana
        ports:
            - 5601:5601

Run docker stack deploy -c stack.yml elasticsearch (or docker-compose -f stack.yml up), wait for it to initialize completely, and visit http://swarm-ip:5601, http://localhost:5601, or http://host-ip:5601 (as appropriate).

Image Variants

The elasticsearch images come in many flavors, each designed for a specific use case.

elasticsearch:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

elasticsearch:alpine

This image is based on the popular Alpine Linux project, available in the alpine official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the alpine image description for examples of how to install packages if you are unfamiliar).

License

View license information for the software contained in this image.

Docker Pull Command

Comments (85)
newdark
9 days ago

+1 on continuing supporting this repo. I tried to go over to the official version but it has a lot of bugs with the way the volumes and networking are configured. Also, it means that you cannot use the Kitematic for Mac which I have to say if your developer can be a huge help.

newdark
9 days ago

I can't find a list of versions available provided by elastic.co. Is there a link some where?

paddysos
a month ago

The new image on elastic site can't be pulled with Docker content trust enabled. And I am not doing so good on firewall front either. It would have been so much easier to have the image here.

dliappis
a month ago

Hi, given the deprecation of the repo, where can I find the alpine version at elastic.co ?

There are important issues with musl libc that make running Elasticsearch on Alpine a non-advisable option. See: https://www.elastic.co/blog/docker-base-centos7

andreilhicas
a month ago

Hi, given the deprecation of the repo, where can I find the alpine version at elastic.co ? Thank you.

joejordan
2 months ago

This image is officially deprecated in favor of the elasticsearch image provided by elastic.co which is available to pull via ...

Why you gotta be difficult?

focorner
2 months ago

I understand that this image has been deprecated, but I'll ask here anyways, in case someone can help.

I am experimenting with version 5.0 of this image on a small EC2 machine (Ubuntu, Micro T2). I adjusted the max and min heap settings using -e ES_JAVA_OPTS="-Xms512m -Xmx512m". The container is starting and running, but it eventually stops after a day, but nothing gets logged, so it's difficult to troubleshoot.

I suspect that the issue is with the memory available on the machine, as it is a very small instance. Can anyone help? Was anyone able to run Elasticsearch (in Docker) on such as small virtual machine in the past?

Thank you for your time.

oscardiedrichs
2 months ago

The reason seems to be that they want people to pay for the X-pack features. Anyone seeing any other explanation for the move?

proligde
3 months ago

+1 - Dear elastic.co! Please continue support for THIS repository here.

yeep
3 months ago

"elasticsearch:latest" still pulling 5.2.2, but the kibana container is at 5.3 and errors when using 5.2.2. Can you push the 5.3 container? I see it on github so I know it exists.

Thank you