docker安装jumpserver

生成SECRET_KEY:

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

生成BOOTSTRAP_TOKEN:

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_TOKEN; fi

启动容器:

docker run -d \
--name jumpserver \
--restart=always \
-p 80:80 \
-p 2222:2222 \
-e SECRET_KEY=$SECRET_KEY \
-e BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN \
-v /home/docker/jumpserver/data:/opt/jumpserver/data \
-v /home/docker/jumpserver/mysql:/var/lib/mysql \
jumpserver/jms_all:1.4.8

最后编辑于:2019/9/10作者: 编程小战

我不入地狱,谁入地狱?

评论已关闭