Dockerfile

  1. FROM archlinux:base-devel
  2. WORKDIR /tmp
  3. ENV SHELL /bin/bash
  4. LABEL name yibo
  5. VOLUME ["/root", "/root/repos"]
  6. ADD .mirrorlist /etc/pacman.d/mirrorlist
  7. RUN yes | pacman -Syu
  8. RUN yes | pacman -S git zsh
  9. # zsh
  10. RUN zsh -c 'git clone https://code.aliyun.com/412244196/prezto.git "$HOME/.zprezto"' &&\
  11. zsh -c 'setopt EXTENDED_GLOB' &&\
  12. zsh -c 'for rcfile in "$HOME"/.zprezto/runcoms/z*; do ln -s "$rcfile" "$HOME/.${rcfile:t}"; done'
  13. ENV SHELL /bin/zsh
  14. # end
  15. # basic tools
  16. RUN yes | pacman -S neovim tree
  17. ENV EDITOR=nvim
  18. ENV VISUAL=nvim
  19. # end
  20. # cpp
  21. RUN yes | pacman -S cmake
  22. # end
  • docker build -t dev:cpp .

  • docker run -itd -p 8080:8080 --name dev -v root:/root -v repos:/root/repos dev:cpp