1. 安装数据库mysql  或者 mariadb

  2. 安装redis

  3. 执行如下命令

if [ "$SECRET_KEY" = "" ]; then SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`; echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc; echo $SECRET_KEY; else echo $SECRET_KEY; fi

 if [ "$BOOTSTRAP_TOKEN" = "" ]; then BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`; echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc; echo $BOOTSTRAP_TOKEN; else echo $BOOTSTRAP


4.安装docker并启动

docker run --name jms_all -d \

    -v /opt/jumpserver:/opt/jumpserver/data/media \

    -p 80:80 \

    -p 2222:2222 \

    -e SECRET_KEY=dDk0I5LRMXXXXXXXXXW482VMAEXXaaJCwt \

    -e BOOTSTRAP_TOKEN=eAJ4iXXXXXXXXXdFXXPo \

    -e DB_HOST=192.168.10.87 \

    -e DB_PORT=3306 \

    -e DB_USER=jumpserver \

    -e DB_PASSWORD=123456 \

    -e DB_NAME=jumpserver \

    -e REDIS_HOST=192.168.10.87 \

    -e REDIS_PORT=6379 \

    -e REDIS_PASSWORD=123456 \

    jumpserver/jms_all:latest