Doris Docker quick build development environment

Environment preparation

  • Install Docker
  • VSCode
    • Remote plugin

Build image

create dockerfile

VSCode replace all by using Ctrl-d

  • <!!! your user !!!>
  • <!!! your user password !!!>
  • <!!! root password !!!>
  • <!!! your git email !!!>
  • <!!! your git username !!!>
  1. FROM apache/incubator-doris:build-env-latest
  2. USER root
  3. WORKDIR /root
  4. RUN echo '<!!! root password !!!>' | passwd root --stdin
  5. RUN yum install -y vim net-tools man wget git mysql lsof bash-completion \
  6. && cp /var/local/thirdparty/installed/bin/thrift /usr/bin
  7. # safer usage, create new user instead of using root
  8. RUN yum install -y sudo \
  9. && useradd -ms /bin/bash <!!! your user !!!> && echo <!!! your user password !!!> | passwd <!!! your user !!!> --stdin \
  10. && usermod -a -G wheel <!!! your user !!!>
  11. USER <!!! your user !!!>
  12. WORKDIR /home/<!!! your user !!!>
  13. RUN git config --global color.ui true \
  14. && git config --global user.email "<!!! your git email !!!>" \
  15. && git config --global user.name "<!!! your git username !!!>"
  16. # install zsh and oh my zsh, easier to use on, you can remove it if you don't need it
  17. USER root
  18. RUN yum install -y zsh \
  19. && chsh -s /bin/zsh <!!! your user !!!>
  20. USER <!!! your user !!!>
  21. RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh \
  22. && git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
  23. && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

run build command

  1. docker build -t doris .

run image

note! problems with mountingDoris Docker quick build development environment - 图4 (opens new window)

See the link above: It is recommended to run the image by mounting the local Doris source code directory as a volume …..

if you are developing on windows, mounting may cause cross-filesystem access problems, please consider setting it manually

  1. docker run -it doris:latest /bin/bash

if you installed zsh, replace plugins in ~/.zshrc after running the container

  1. plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

create directory and download doris

  1. su <your user>
  2. mkdir code && cd code
  3. git clone https://github.com/apache/incubator-doris.git

Compile

Note:

use the following command first time compiling

  1. sh build.sh --clean --be --fe --ui

it is because build-env-for-0.15.0 version image upgraded thrift(0.9 -> 0.13), so you need to use —clean command to force use new version of thrift to generate code files, otherwise it will cause incompatibilities.

compile Doris

  1. sh build.sh

Run

manually create meta_dir metadata storage location, default value is ${DORIS_HOME}/doris-meta

  1. mkdir meta_dir

launch FE

  1. cd output/fe
  2. sh bin/start_fe.sh --daemon

launch BE

  1. cd output/be
  2. sh bin/start_be.sh --daemon

mysql-client connect

  1. mysql -h 127.0.0.1 -P 9030 -u root