Dockerfile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 zip unzip tree tmux \
  7. build-essential
  8. RUN apt -y autoremove
  9. RUN apt -y clean
  10. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  11. RUN locale-gen
  12. RUN update-locale LANG=en_US.UTF-8
  13. RUN update-alternatives --set editor /usr/bin/vim.basic
  14. RUN mkdir -p $HOME/downloads $HOME/build $HOME/local $HOME/tmp
  15. # https://github.com/ohmyzsh/ohmyzsh
  16. RUN git clone https://github.com/ohmyzsh/ohmyzsh.git $HOME/.oh-my-zsh
  17. RUN cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc
  18. RUN echo 'export LANG=en_US.UTF-8' >> $HOME/.zshrc
  19. RUN echo 'export LC_ALL=en_US.UTF-8' >> $HOME/.zshrc
  20. RUN echo 'export PATH=$HOME/.local/bin:$PATH' >> $HOME/.zshrc
  21. RUN git config --global core.quotepath false \
  22. && git config --global http.version HTTP/1.1 \
  23. && git config --global pull.rebase false \
  24. && git config --global url."https://".insteadOf git://
  25. RUN echo 'set-option -g history-limit 102400' > $HOME/.tmux.conf \
  26. && echo 'set-option -g default-shell "/bin/zsh"' >> $HOME/.tmux.conf
  27. # https://github.com/nvm-sh/nvm
  28. ENV NVM_VERSION "v0.40.1"
  29. RUN git clone -b ${NVM_VERSION} https://github.com/nvm-sh/nvm.git $HOME/.nvm
  30. RUN echo 'export NVM_DIR="$HOME/.nvm"' >> $HOME/.zshrc
  31. RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $HOME/.zshrc
  32. RUN echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> $HOME/.zshrc
  33. RUN zsh -c "source $HOME/.zshrc \
  34. && nvm install --lts"
  35. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  36. RUN locale-gen
  37. RUN update-locale LANG=en_US.UTF-8
  38. RUN update-alternatives --set editor /usr/bin/vim.basic
  39. RUN mkdir -p $HOME/downloads
  40. # https://opensearch.org/downloads.html#opensearch
  41. ARG OPENSEARCH_ARCH
  42. ENV OPENSEARCH_VERSION "2.17.0"
  43. ENV OPENSEARCH_JAVA_HOME "/opt/opensearch-${OPENSEARCH_VERSION}/jdk"
  44. RUN wget -q -P $HOME/downloads \
  45. https://artifacts.opensearch.org/releases/bundle/opensearch/${OPENSEARCH_VERSION}/opensearch-${OPENSEARCH_VERSION}-linux-${OPENSEARCH_ARCH}.tar.gz
  46. RUN cd /opt && tar xf $HOME/downloads/opensearch-${OPENSEARCH_VERSION}-linux-${OPENSEARCH_ARCH}.tar.gz
  47. RUN echo "network.host: 0.0.0.0" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
  48. RUN echo "discovery.type: single-node" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
  49. RUN echo "plugins.security.disabled: true" >> /opt/opensearch-${OPENSEARCH_VERSION}/config/opensearch.yml
  50. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | tee /VERSION
  51. VOLUME /workspace
  52. WORKDIR /workspace
  53. CMD ["/bin/zsh", "-l"]