Dockerfile 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. FROM ubuntu:latest
  2. LABEL maintainer="Jeremy Zheng"
  3. ENV DEBIAN_FRONTEND noninteractive
  4. RUN apt update
  5. RUN apt -y upgrade
  6. RUN apt -y install wget vim locales locales-all tzdata
  7. RUN apt -y autoremove
  8. RUN apt -y clean
  9. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  10. RUN locale-gen
  11. RUN update-locale LANG=en_US.UTF-8
  12. RUN update-alternatives --set editor /usr/bin/vim.basic
  13. RUN mkdir -p $HOME/downloads
  14. # https://opensearch.org/downloads.html#opensearch
  15. ARG OPENSEARCH_ARCH
  16. ENV OPENSEARCH_VERSION "2.17.0"
  17. ENV OPENSEARCH_JAVA_HOME "/opt/opensearch-${OPENSEARCH_VERSION}/jdk"
  18. RUN wget -q -P $HOME/downloads \
  19. https://artifacts.opensearch.org/releases/bundle/opensearch/${OPENSEARCH_VERSION}/opensearch-${OPENSEARCH_VERSION}-linux-${OPENSEARCH_ARCH}.tar.gz
  20. RUN cd /opt && tar xf $HOME/downloads/opensearch-${OPENSEARCH_VERSION}-linux-${OPENSEARCH_ARCH}.tar.gz
  21. RUN echo "network.host: 0.0.0.0" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
  22. RUN echo "discovery.type: single-node" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
  23. RUN echo "plugins.security.disabled: true" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
  24. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | tee /VERSION
  25. WORKDIR /opt/opensearch-${OPENSEARCH_VERSION}
  26. CMD ["/opt/opensearch-${OPENSEARCH_VERSION}/bin/opensearch"]