Dockerfile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 zsh git locales locales-all \
  7. vim tzdata zip unzip tree tmux \
  8. build-essential
  9. RUN apt -y autoremove
  10. RUN apt -y clean
  11. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  12. RUN locale-gen
  13. RUN update-locale LANG=en_US.UTF-8
  14. RUN update-alternatives --set editor /usr/bin/vim.basic
  15. RUN mkdir -p $HOME/downloads $HOME/build $HOME/local $HOME/tmp
  16. # https://github.com/ohmyzsh/ohmyzsh
  17. RUN git clone https://github.com/ohmyzsh/ohmyzsh.git $HOME/.oh-my-zsh
  18. RUN cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc
  19. RUN echo 'export LANG=en_US.UTF-8' >> $HOME/.zshrc
  20. RUN echo 'export LC_ALL=en_US.UTF-8' >> $HOME/.zshrc
  21. RUN echo 'export PATH=$HOME/.local/bin:$PATH' >> $HOME/.zshrc
  22. RUN git config --global core.quotepath false \
  23. && git config --global http.version HTTP/1.1 \
  24. && git config --global pull.rebase false \
  25. && git config --global url."https://".insteadOf git://
  26. RUN echo 'set-option -g history-limit 102400' > $HOME/.tmux.conf \
  27. && echo 'set-option -g default-shell "/bin/zsh"' >> $HOME/.tmux.conf
  28. # https://github.com/nvm-sh/nvm
  29. ENV NVM_VERSION "v0.40.1"
  30. RUN git clone -b ${NVM_VERSION} https://github.com/nvm-sh/nvm.git $HOME/.nvm
  31. RUN echo 'export NVM_DIR="$HOME/.nvm"' >> $HOME/.zshrc
  32. RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $HOME/.zshrc
  33. RUN echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> $HOME/.zshrc
  34. RUN zsh -c "source $HOME/.zshrc \
  35. && nvm install --lts"
  36. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | tee /VERSION
  37. VOLUME /workspace
  38. WORKDIR /workspace
  39. CMD ["/bin/zsh", "-l"]