Dockerfile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # STAGE 1,在临时镜像中编译 tintin
  2. FROM alpine:latest
  3. # 安装编译器和依赖包
  4. RUN apk update \
  5. && apk add --no-cache git gcc libc-dev zlib-dev zlib-static pcre-dev make curl
  6. RUN git clone --depth 1 https://github.com/junegunn/vim-plug.git /vim-plug
  7. RUN git clone --depth 1 https://github.com/dzpao/vim-mbs.git /vim-mbs
  8. RUN git clone --depth 1 https://github.com/morhetz/gruvbox.git /gruvbox
  9. RUN git clone --depth 1 https://github.com/yegappan/mru.git /mru
  10. RUN git clone --depth 1 https://github.com/jlanzarotta/BufExplorer.git /BufExplorer
  11. RUN git clone --depth 1 https://github.com/mhinz/vim-startify.git /vim-startify
  12. RUN git clone --depth 1 https://github.com/mudclient/tintin.git --branch beta-develop
  13. WORKDIR /tintin/src/
  14. # 这里 hack 了一下 gcc,强制静态编译。
  15. ENV PATH=.:/sbin:/bin:/usr/sbin:/usr/bin
  16. RUN echo '/usr/bin/gcc --static $*' > gcc && chmod +x gcc
  17. RUN ./configure && make && strip tt++
  18. # STAGE 2: 生成最终镜像
  19. FROM alpine:latest
  20. LABEL name="paotin"
  21. LABEL maintainer="dzp <danzipao@gmail.com>"
  22. ENV LANG=zh_CN.UTF8 \
  23. TERM=xterm-256color \
  24. SHELL=/bin/bash \
  25. HOME=/paotin \
  26. PATH=/paotin/bin:/usr/sbin:/usr/bin:/sbin:/bin
  27. WORKDIR /paotin/
  28. RUN apk update \
  29. && apk add --no-cache tmux bash ncurses less neovim nano
  30. # 设置时区为上海
  31. RUN apk add --no-cache tzdata \
  32. && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  33. && echo "Asia/Shanghai" > /etc/timezone \
  34. && apk del tzdata
  35. COPY profile.sh /paotin/.bash_profile
  36. COPY tmux.conf /paotin/.tmux.conf
  37. COPY HOW-TO-PLAY.md /paotin/
  38. COPY bin /paotin/bin/
  39. COPY docs /paotin/docs/
  40. COPY etc /paotin/etc/
  41. COPY framework /paotin/framework/
  42. COPY plugins /paotin/plugins/
  43. COPY mud /paotin/mud/
  44. COPY ids/EXAMPLE /paotin/ids/
  45. COPY ids/DEFAULT /paotin/ids/
  46. COPY ids/LOCAL /paotin/ids/
  47. COPY init.vim /paotin/.config/nvim/
  48. COPY --from=0 /vim-plug/plug.vim /paotin/.local/share/nvim/site/autoload/plug.vim
  49. COPY --from=0 /gruvbox /paotin/.local/share/nvim/plugged/gruvbox/
  50. COPY --from=0 /vim-mbs /paotin/.local/share/nvim/plugged/vim-mbs/
  51. COPY --from=0 /mru /paotin/.local/share/nvim/plugged/mru/
  52. COPY --from=0 /BufExplorer /paotin/.local/share/nvim/plugged/BufExplorer/
  53. COPY --from=0 /vim-startify /paotin/.local/share/nvim/plugged/BufExplorer/
  54. COPY --from=0 /tintin/src/tt++ /paotin/bin/
  55. RUN mkdir -p /paotin/log/
  56. RUN mkdir -p /paotin/tmux/
  57. ENTRYPOINT ["/bin/bash", "-i", "/paotin/bin/start-ui"]