springboot(25)Docker部署
序言
docker build -t springboot .
docker run --name springboot -d -p 8080:8080 springboot
sudo docker run springboot
http://192.168.229.133:8080/home/index
docker-machine ip 192.168.229.133
http://192.168.229.133:8080/info
yum install net-tools
netstart -anp|grep 8080
docker rm -f springboot
docker ps -a
docker inspect springboot
docker run -di --name 容器名称 -p 8080:8080 镜像名称
docker logs -f --tail=100 springboot
docker run -d -p 8080:8080 springboot
防火墙
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
那怎么开启一个端口呢
添加(--permanent永久生效,没有此参数重启后失效)
firewall-cmd --zone=public --add-port=8080/tcp --permanent
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=8080/tcp
删除
firewall-cmd --zone= public --remove-port=8080/tcp --permanent