一、环境信息
1、jumpserver 192.168.137.129 CentOS6.4 kernel版本为 3.10.5-3.el6.x86_64
2、客户机 dev01-04
3、docker镜像 jiaxiangkong/jumpserver_docker:0.3.2
二、在129上准备基本环境
[root@localhost ~]# yum install -y epel-release
[root@localhost ~]# yum install -y curl
[root@localhost ~]# service iptables stop
[root@localhost ~]# 关闭selinux
升级内核到3.10.0以上(rpm包下载:http://pan.baidu.com/s/1cGrccQ)
[root@localhost ~]# uname -r
3.10.5-3.el6.x86_64
安装docker
[root@localhost ~]# yum install device-mapper-event-libs
[root@localhost ~]# yum install -y https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
[root@localhost ~]# docker -v
Docker version 1.7.1, build 786b29d
三、安装mysql数据库
[root@localhost ~]# yum install -y mysql
[root@localhost ~]# service mysqld start
[root@localhost ~]# mysql -e "create database jumpdb charset='utf8';"
[root@localhost ~]# mysql -e "grant all on jumpdb.* to 'jumpdb'@'%' identified by 'jumppasswd';"
[root@localhost ~]# mysql -e "flush privileges;"
[root@localhost ~]# mysql -e "show databases;"
四、安装jumpserver
4.1拉取镜像
[root@localhost ~]# docker pull jiaxiangkong/jumpserver_docker:0.3.2
4.2、配置启动脚本并启动
1 docker stop jms && docker rm jms 2 docker run --name jms \ 3 -p 2222:22 \ 4 -p 8888:80 \ 5 -v /root/jumpserver/jms_data:/data \ 6 -v /etc/localtime:/etc/localtime:ro \ 7 -e USE_MYSQL=1 \ 8 -e MYSQL_ENGINE=mysql \ 9 -e MYSQL_HOST=192.168.137.129\ 10 -e MYSQL_PORT=3306 \ 11 -e MYSQL_USER=jumpdb \ 12 -e MYSQL_PASS=jumppasswd \ 13 -e MYSQL_NAME=jumpdb \ 14 -e USE_MAIL=true \ 15 -e MAIL_ENABLED=1 \ 16 -e MAIL_HOST=smtp.126.com \ 17 -e MAIL_PORT=25 \ 18 -e MAIL_USER=88888@126.com \ 19 -e MAIL_PASS='88888=' \ 20 -e MAIL_USE_TLS=False \ 21 -e MAIL_USE_SSL=False \ 22 --restart=always \ 23 -d jumpserver:0.3.2 24 docker exec -ti jms /bin/sh /data/script/input_ip.sh
start_jms.sh
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:基于docker搭建jumpserver堡垒机 - Python技术站