Dockerfile 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. FROM ubuntu:jammy
  2. LABEL maintainer="Jeremy Zheng"
  3. ENV DEBIAN_FRONTEND noninteractive
  4. RUN apt update
  5. RUN apt install -y lsb-release
  6. RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" > /etc/apt/sources.list
  7. RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse" >> /etc/apt/sources.list
  8. RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse" >> /etc/apt/sources.list
  9. RUN dpkg --add-architecture arm64
  10. RUN echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs) main restricted universe multiverse" >> /etc/apt/sources.list
  11. RUN echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-security main restricted universe multiverse" >> /etc/apt/sources.list
  12. RUN echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main restricted universe multiverse" >> /etc/apt/sources.list
  13. RUN apt update
  14. RUN apt -y upgrade
  15. RUN apt -y install zsh git locales locales-all \
  16. vim tzdata zip unzip tree tmux \
  17. build-essential crossbuild-essential-arm64 clang lldb lld mold \
  18. cmake pkg-config libtool automake autoconf autoconf-archive binutils cpio \
  19. debhelper bison flex ninja-build \
  20. python3 python3-distutils python3-dev python3-pip virtualenv
  21. RUN apt -y autoremove
  22. RUN apt -y clean
  23. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  24. RUN locale-gen
  25. RUN update-locale LANG=en_US.UTF-8
  26. RUN update-alternatives --set editor /usr/bin/vim.basic
  27. RUN mkdir -p $HOME/downloads $HOME/build $HOME/local $HOME/tmp
  28. # https://github.com/ohmyzsh/ohmyzsh
  29. RUN git clone https://github.com/ohmyzsh/ohmyzsh.git $HOME/.oh-my-zsh
  30. RUN cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc
  31. RUN echo 'export LANG=en_US.UTF-8' >> $HOME/.zshrc
  32. RUN echo 'export LC_ALL=en_US.UTF-8' >> $HOME/.zshrc
  33. RUN echo 'export PATH=$HOME/.local/bin:$PATH' >> $HOME/.zshrc
  34. RUN git config --global core.quotepath false \
  35. && git config --global http.version HTTP/1.1 \
  36. && git config --global pull.rebase false \
  37. && git config --global url."https://".insteadOf git://
  38. RUN echo 'set-option -g history-limit 102400' > $HOME/.tmux.conf \
  39. && echo 'set-option -g default-shell "/bin/zsh"' >> $HOME/.tmux.conf
  40. # https://github.com/nvm-sh/nvm
  41. ENV NVM_VERSION "v0.39.3"
  42. RUN git clone -b ${NVM_VERSION} https://github.com/nvm-sh/nvm.git $HOME/.nvm
  43. RUN echo 'export NVM_DIR="$HOME/.nvm"' >> $HOME/.zshrc
  44. RUN echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $HOME/.zshrc
  45. RUN echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> $HOME/.zshrc
  46. RUN zsh -c "source $HOME/.zshrc \
  47. && nvm install node \
  48. && nvm use node \
  49. && npm i yarn -g"
  50. RUN echo 'export PATH=$HOME/.yarn/bin:$PATH' >> $HOME/.zshrc
  51. # https://www.rust-lang.org/tools/install
  52. RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
  53. RUN zsh -c "source $HOME/.cargo/env && rustup target add aarch64-unknown-linux-gnu"
  54. # https://github.com/grpc/grpc
  55. ENV GRPC_VERSION "v1.51.1"
  56. RUN git clone --recurse-submodules -b $GRPC_VERSION https://github.com/grpc/grpc.git $HOME/downloads/grpc
  57. RUN apt install -y libssl-dev
  58. RUN zsh -c "source $HOME/.zshrc \
  59. && mkdir -pv $HOME/build/grpc \
  60. && cd $HOME/build/grpc \
  61. && cmake -DCMAKE_BUILD_TYPE=Release \
  62. -DgRPC_INSTALL=ON \
  63. -DgRPC_SSL_PROVIDER=package \
  64. -DgRPC_BUILD_TESTS=OFF \
  65. -DCMAKE_INSTALL_PREFIX=$HOME/.local $HOME/downloads/grpc \
  66. && make -j \
  67. && make install"
  68. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | tee /VERSION
  69. VOLUME /workspace
  70. WORKDIR /workspace
  71. CMD ["/bin/zsh", "-l"]