Files
doris/docker
FreeOnePlus 980f28f9e2 [feat](docker)Modify the init_be and start_be scripts to meet the requirements for rapid Docker startup(Merge 2.1). (#45858)
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #45267

Master PR: #45269

Problem Summary:

To meet the needs of rapid Docker startup, I have made adjustments to
two related scripts in the Docker startup process. First, I added a env
`SKIP_CHECK_ULIMIT` to the `start_be.sh` script, which will skip the
size checks for `swap`, `ulimit`, and `max_map_count`. At the same time,
I used `--console` to start the process and print logs. The reason why I
did not use the `--daemon` daemon command to execute is that starting
with a foreground log printing method in a Docker container is the
correct and reliable approach.

At the same time, I added a check logic for a `be.conf` configuration
item in the `init_be.sh` script: if it is the first time starting,
append the export `SKIP_CHECK_ULIMIT=true` to skip the `ulimit` value
check in the BE process. In summary, these adjustments can meet the
basic requirements for rapid Docker startup usage.
2024-12-25 12:11:14 +08:00
..

Doris Develop Environment based on docker

Preparation

  1. Download the Doris code repo

    $ cd /to/your/workspace/
    $ git clone https://github.com/apache/doris.git
    $ cd doris
    $ git submodule update --init --recursive
    

    You can remove the .git dir in doris/ to make the dir size smaller. So that the following generated docker image can be smaller.

  2. Copy Dockerfile

    $ cd /to/your/workspace/
    $ cp doris/docker/Dockerfile ./
    

After preparation, your workspace should like this:

.
├── Dockerfile
├── doris
│   ├── be
│   ├── bin
│   ├── build.sh
│   ├── conf
│   ├── DISCLAIMER-WIP
│   ├── docker
│   ├── docs
│   ├── env.sh
│   ├── fe
│   ├── ...

Build docker image

$ cd /to/your/workspace/
$ docker build -t doris:v1.0  .

doris is docker image repository name and v1.0 is tag name, you can change them to whatever you like.

Use docker image

This docker image you just built does not contain Doris source code repo. You need to download it first and map it to the container. (You can just use the one you used to build this image before)

$ docker run -it -v /your/local/path/doris/:/root/doris/ doris:v1.0
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/doris-DORIS-x.x.x-release/:/root/doris-DORIS-x.x.x-release/ doris:v1.0

Then you can build source code inside the container.

$ cd /root/doris/
$ sh build.sh

NOTICE

The default JDK version is openjdk 11, if you want to use openjdk 8, you can run the command:

$ alternatives --set java java-1.8.0-openjdk.x86_64
$ alternatives --set javac java-1.8.0-openjdk.x86_64
$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0

The version of jdk you used to run FE must be the same version you used to compile FE.

Latest update time

2022-1-23