Elasticsearch with Docker

Wolf
3 min readJan 15, 2023
Photo by Chris Ried on Unsplash

We have available online a lot of snippets that we can use if we want to start a container with Elasticsearch with base configuration in our computer.

But if we want a Elasticsearch with synonyms files and custom configuration? Can be a little more difficult to find a snippet with all the details. Having that in mind I decide to make a more detailed post with custom configurations for our docker container.

Requirements:

  • Docker already installed in our system
  • Login in Docker
  • Visual Studio code or some editor from your preference to create and edit the files

First, the Dockerfile:

  • Create a new file called Dockerfile without extension where we will set all the steps that we need to customize our Elasticsearch installation.
  • Decide what will be the version that we want to use. For the example, we will be using the 8.6.0.
  • The first line will be:
From docker.elastic.co/elasticsearch/elasticsearch:8.6.0 as elasticsearch
  • Add synonym files — the synonyms_path should be the path in the host for the folder containing synonym's files inside the same folder where we have the Dockerfile:
ADD ./{synonyms_path}/…

--

--

Wolf

A software engineer looking for learning more and share my knowledge.