系统硬件
cpu最少4核
内存最少4G
硬盘100以上
其他随意
关闭防火墙
[root@2 ~]# systemctl stop firewalld.service [root@2 ~]# systemctl disable firewalld.service [root@2 ~]# setenforce 0 [root@2 ~]# vim /etc/sysconfig/selinux SELINUX=disabled
下载博主提供的docker镜像
镜像有点大,喝杯咖啡的功夫即可。
[root@iZj6cffp8anaguadrxuwx8Z ~]# docker pull centoscn/bbs.centoscn.vip:v1.1.1 v1.1.1: Pulling from centoscn/bbs.centoscn.vip f2d1d709a1da: Already exists 27d8c425903c: Pull complete 8a8e3b28c7e1: Pull complete 616a75d4a4f5: Pull complete da875922431b: Pull complete 28b0501d263e: Pull complete c592cbf16397: Pull complete Digest: sha256:db9c42395d403cd96112e1021e321f16c3b23b0599a681fff85ebb457447d71f Status: Downloaded newer image for centoscn/bbs.centoscn.vip:v1.1.1 [root@iZj6cffp8anaguadrxuwx8Z ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE centoscn/bbs.centoscn.vip_google v1.1.1 4dcb3bc76886 2 days ago 616MB centoscn/bbs.centoscn.vip v1.1.1 a75f5b86675e 15 months ago 2.58GB
用镜像启动容器并进入容器
[root@iZj6cffp8anaguadrxuwx8Z ~]# docker run -itd -p 80:8080 centoscn/bbs.centoscn.vip:v1.1.1 bash a338170995d8c5d761addc5a57c90c613a3b2587218e67283aea400825fddd12
进入容器
[root@iZj6cffp8anaguadrxuwx8Z ~]# docker exec -it a338170 bash [root@a338170995d8 /]#
修改连接地址
[root@f8be9699c7ed /]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.2 netmask 255.255.0.0 broadcast 0.0.0.0 inet6 fe80::42:acff:fe11:2 prefixlen 64 scopeid 0x20<link> ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 20 bytes 1488 (1.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 16 bytes 1176 (1.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@f8be9699c7ed /]# vi /home/cafintech/App/audit/conf/application.properties spring.application.name=audit server.port=8080 #\u6570\u636E\u5E93\u914D\u7F6E spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://172.17.0.2:3306/internal_tmp?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true spring.datasource.username=root spring.datasource.password=123456
启动服务
[root@f8be9699c7ed /]# /etc/init.d/mysqld start Starting MySQL.Logging to '/data/mysql/f8be9699c7ed.err'. SUCCESS! [root@f8be9699c7ed audit]# pwd /home/cafintech/App/audit [root@f8be9699c7ed audit]# ./bin/start.sh process 342 is start ok.
查看端口
[root@f8be9699c7ed audit]# netstat -lnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::3306 :::* LISTEN - tcp6 0 0 :::8080 :::* LISTEN 342/java Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 40108 - /tmp/mysql.sock
退出docker即可
查看宿主机,出现如下即可正常
[root@2 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f8be9699c7ed centos7.2_audit_nue "bash" 24 minutes ago Up 24 minutes 22/tcp, 3306/tcp, 0.0.0.0:80->8080/tcp jovial_mahavira [root@2 ~]# ss -tnlp State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* users:(("sshd",pid=978,fd=3)) LISTEN 0 100 127.0.0.1:25 *:* users:(("master",pid=1354,fd=13)) LISTEN 0 128 :::80 :::* users:(("docker-proxy-cu",pid=12606,fd=4)) LISTEN 0 50 :::8080 :::* users:(("java",pid=1664,fd=161)) LISTEN 0 128 :::22 :::* users:(("sshd",pid=978,fd=4)) LISTEN 0 100 ::1:25 :::* users:(("master",pid=1354,fd=14))
Web页面验证
浏览器输入你宿主机ip地址
http://192.168.1.88/index
登陆账号和密码
admin/876297859
继续阅读
- 我的QQ
- QQ扫一扫
-
- 我的头条
- 头条扫一扫
-
评论