硬件要求 : 
建议配置 8 核 或以上 CPU,8GB 或以上内存
CPU 需支持 AVX2 指令集 
查看命令cat /proc/cpuinfo | grep avx2 有结果输出即表明CPU支持。如果无输出,建议更换支持AVX2的机器。
安装docker
就不说了
新建进入目录 /home/StarRocks
创建以下文件   Dockerfile 、 run_script.sh 
touch Dockerfile
FROM centos:centos7
# Prepare StarRocks Installer. Replace the "2.4.0" below with the StarRocks version that you want to deploy.
ENV StarRocks_version=2.4.0
# Create directory for deployment.
ENV StarRocks_home=/data/deploy
# Replace the "<url_to_download_specific_ver_of_starrocks>" below with the download path of the StarRocks that you want to deploy.
ENV StarRocks_url=https://releases.starrocks.io/starrocks/StarRocks-2.4.4.tar.gz
# Install StarRocks.
RUN yum -y install wget
RUN mkdir -p $StarRocks_home
RUN wget -SO $StarRocks_home/StarRocks-${StarRocks_version}.tar.gz  $StarRocks_url
RUN cd $StarRocks_home && tar zxf StarRocks-${StarRocks_version}.tar.gz
# Install Java JDK.
RUN yum -y install java-1.8.0-openjdk-devel.x86_64
RUN rpm -ql java-1.8.0-openjdk-devel.x86_64 | grep bin$
# Create directory for FE meta and BE storage in StarRocks.
RUN mkdir -p $StarRocks_home/StarRocks-${StarRocks_version}/fe/meta
RUN mkdir -p $StarRocks_home/StarRocks-${StarRocks_version}/be/storage
# Install relevant tools.
RUN yum -y install mysql net-tools telnet
# Run Setup script.
COPY run_script.sh $StarRocks_home/run_script.sh
RUN chmod +x $StarRocks_home/run_script.sh
CMD $StarRocks_home/run_script.sh


在Dockerfile同级目录下创建run_script.sh 文件
touch  run_script.sh 

#!/bin/bash
# Set JAVA_HOME.
JAVA_INSTALL_DIR=/usr/lib/jvm/$(rpm -aq | grep java-1.8.0-openjdk-1.8.0)
export JAVA_HOME=$JAVA_INSTALL_DIR
# Start FE.
cd $StarRocks_home/StarRocks-$StarRocks_version/fe/bin/
./start_fe.sh --daemon
# Start BE.
cd $StarRocks_home/StarRocks-$StarRocks_version/be/bin/
./start_be.sh --daemon
# Sleep until the cluster starts.
sleep 30;
# Set BE server IP.
IP=$(ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{print $2}')
mysql -uroot -h${IP} -P 9030 -e "alter system add backend '${IP}:9050';"
# Loop to detect the process.
while sleep 60; do
  ps aux | grep starrocks | grep -q -v grep
  PROCESS_STATUS=$?
  if [ ${PROCESS_STATUS} -ne 0 ]; then
    echo "one of the starrocks process already exit."
    exit 1;
  fi
done
运行以下命令构建Docker 镜像。
docker build --no-cache --progress=plain -t starrocks:2.4.4 .
先简单启动容器,然后通过docker cp命名把容器内的be 和 fe的配置文件拷贝出来
docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 --privileged=true -itd --name starrocks-test starrocks:2.4.4
拷贝配置文件到本地 /home/StarRocks/config 目录中
docker cp  2f29c464:/home/StarRocks/deploy/StarRocks-2.4.4/be/conf/be.conf /home/StarRocks/config
docker cp  2f29c464:/home/StarRocks/deploy/StarRocks-2.4.4/fe/conf/fe.conf /home/StarRocks/config
docker run -d \
-p 9030:9030  -p 8030:8030 -p 8040:8040 \
-v /etc/localtime:/etc/localtime:ro \
-v /home/StarRocks/data/be/log:/home/StarRocks/deploy/StarRocks-2.4.4/be/log \
-v /home/StarRocks/data/be/storage:/home/StarRocks/deploy/StarRocks-2.4.4/be/storage \
-v /home/StarRocks/data/fe/log:/home/StarRocks/deploy/StarRocks-2.4.4/fe/log  \
-v /home/StarRocks/data/fe/meta:/home/StarRocks/deploy/StarRocks-2.4.4/fe/meta \
-v /home/StarRocks/config/be.conf:/home/StarRocks/deploy/StarRocks-2.4.4/be/conf/be.conf \
-v /home/StarRocks/config/fe.conf:/home/StarRocks/deploy/StarRocks-2.4.4/fe/conf/fe.conf \
--name starrocks-sigle-dne  \
--privileged=true  \
starrocks:2.4.4
启动成功以后,进入容器内部,修改root账户的密码
docker exec -it 容器id  /bin/bash
-- 链接到starRocks
mysql -uroot -h127.0.0.1 -P 9030

-- 修改root密码
SET PASSWORD FOR 'root' = PASSWORD('xxxxxxxxxxxxxxx');


-- 以后为创建新用户,然后授权media_stream这个库的权限权限。
CREATE USER 'dahai'@'%' IDENTIFIED BY '123456';

GRANT ALL PRIVILEGES ON media_stream.* TO 'dahai'@'%';

FLUSH PRIVILEGES;

--  如果是mysql的话,还有一下操作,starrocks没有验证
GRANT PROCESS ON *.* TO 'dahai'@'%';

flush privileges;

show processlist