Procházet zdrojové kódy

:wrench: add open-search docker file

Jeremy Zheng před 1 rokem
rodič
revize
225d02a3b1

+ 31 - 0
docker/open-search/Dockerfile

@@ -0,0 +1,31 @@
+FROM ubuntu:latest
+LABEL maintainer="Jeremy Zheng"
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt update
+RUN apt -y upgrade
+RUN apt -y install vim locales locales-all tzdata
+RUN apt -y autoremove
+RUN apt -y clean
+
+RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
+RUN locale-gen
+RUN update-locale LANG=en_US.UTF-8
+RUN update-alternatives --set editor /usr/bin/vim.basic
+
+# https://opensearch.org/downloads.html#opensearch
+ENV OPENSEARCH_VERSION "2.17.0"
+ENV OPENSEARCH_JAVA_HOME "/opt/opensearch-${OPENSEARCH_VERSION}/jdk"
+RUN wget -q -P $HOME/downloads \
+    https://artifacts.opensearch.org/releases/bundle/opensearch/${OPENSEARCH_VERSION}/opensearch-${OPENSEARCH_VERSION}-linux-arm64.tar.gz
+RUN cd /opt && tar xf $HOME/downloads/opensearch-${OPENSEARCH_VERSION}-linux-x64.tar.gz 
+RUN echo "network.host: 0.0.0.0" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
+RUN echo "discovery.type: single-node" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml 
+RUN echo "plugins.security.disabled: true" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
+
+RUN echo "$(date -u +%4Y%m%d%H%M%S)" | tee /VERSION
+
+WORKDIR /opt/opensearch-${OPENSEARCH_VERSION}
+
+CMD ["/opt/opensearch-${OPENSEARCH_VERSION}/bin/opensearch"]

+ 15 - 0
docker/open-search/build.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+export VERSION=$(date "+%4Y%m%d%H%M%S")
+export CODE="mint-open-search"
+
+podman pull ubuntu:latest
+podman build -t $CODE .
+podman save --format=oci-archive -o $CODE-$VERSION.tar $CODE
+md5sum $CODE-$VERSION.tar >$CODE-$VERSION.md5
+
+echo "done($CODE-$VERSION.tar)."
+
+exit 0

+ 10 - 0
docker/open-search/start.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+export CODE="mint-open-search"
+export NAME="$CODE-$USER"
+
+if podman container exists $NAME; then
+    podman start -i -a $NAME
+else
+    podman run --name $NAME -it --events-backend=file --hostname=mint --network host -v $PWD:/workspace:z $CODE
+fi