Public Repository

Last pushed: 2 years ago
Short Description
nvite's fork of dockerfiles/elasticsearch
Full Description

ElasticSearch Dockerfile

This repository contains Dockerfile of ElasticSearch for nvite's automated build published to the public Docker Hub Registry.

Base Docker Image

Installation

  1. Install Docker.

  2. Download automated build from public Docker Hub Registry: docker pull nvite/elasticsearch

    (alternatively, you can build an image from Dockerfile: docker build -t="nvite/elasticsearch" github.com/nvite/dockerfile-elasticsearch)

Usage

  1. Set up the env on the host machine:

    • $ES_HOSTS=master.ip.addresses,for.unicast.discovery
    • $ES_MASTER=true|false
    • $PRIVATE_IP (internal interface, if not already set)

      docker run -d -p $PRIVATE_IP:9200:9200 -p $PRIVATE_IP:9300:9300 -e ES_HOSTS -e ES_MASTER -e PRIVATE_IP nvite/elasticsearch

Attach persistent/shared directories

  1. Create a mountable data directory <data-dir> on the host.

  2. Create ElasticSearch config file at <data-dir>/elasticsearch.yml.

    path:
     logs: /data/log
     data: /data/data
    
  3. Start a container by mounting data directory and specifying the custom configuration file:

    docker run -d -p $PRIVATE_IP:9200:9200 -p $PRIVATE_IP:9300:9300 -v <data-dir>:/data dockerfile/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml
    

After few seconds, open http://<host>:9200 to see the result.

Docker Pull Command
Owner
nvite

Comments (0)