run jumper server

 

1. 生成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
$ 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

 

 

2. create database:
> create database jumpserver default charset 'utf8';
> grant all on jumpserver.* to 'jumpserver'@'%' identified by 'jumpserver.2019';

 

3. run docker:
docker run --name jms_all -d --restart=always -p 80:80 -p 2222:2222 \
-e DB_HOST=172.16.11.15 \
-e DB_PORT=3306 \
-e DB_USER=jumpserver \
-e DB_PASSWORD=jumpserver.2019 \
-e DB_NAME=jumpserver \
-e SECRET_KEY=$SECRET_KEY \
-e BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN \
jumpserver/jms_all:latest

posted on 2020-01-14 17:51  tengq  阅读(135)  评论(0编辑  收藏  举报

导航