I have read several articles on internet about how to make your own docker image and after several tests I can say that only way which worked for me was to use official elasticsearch image and modify it.

But do not try to change resulting CMD.

So I created something like this:

FROM elasticsearch:2.3.4

RUN cd /usr/share/elasticsearch/bin && ./plugin install license && echo "license installed" && \
./plugin install royrusso/elasticsearch-HQ && echo "HQ installed" && \
./plugin install delete-by-query && echo "delete-by-query installed" 

Commands “echo” are not necessary, the help me to track build of the image.