Java 开启Debug模式
启动镜像-Pvt
docker run -itd \
--entrypoint /bin/sh \
--volume /mnt/000.Docker/003.Lit_Information:/logs \
--add-host pvt-mysql.litsoft.com.cn:172.17.112.126 \
--restart always \
--memory 2g \
--user root \
--name Lit_manHour \
--hostname Lit_manHour \
-p 5005:5005 \
-p 10071:8080 \
hub.xxxx.com/project-name/manhour-test:v1.99
# 5005:Debug所需端口
# 10071:8080 服务端口
进入容器
docker exec -it Lit_manHour /bin/sh
开启Debug
java -jar /Lit_manHour.jar
#示例
java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -Xmn1500m -Xss256k -XX:SurvivorRatio=8 -XX:ParallelGCThreads=16 -XX:CMSFullGCsBeforeCompaction=20 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGCDetails -jar /Lit_manHour.jar --spring.profiles.instaceId=1 --server.port=8080 --spring.profiles.active=pvt NACOS-ADDR=172.17.112.126:8849 SENTINEL-ADDR=172.17.112.126:8858
#示例
java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -Xmn1500m -Xss256k -XX:SurvivorRatio=8 -XX:ParallelGCThreads=16 -XX:CMSFullGCsBeforeCompaction=20 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGCDetails -jar /Lit_Reimburse.jar --spring.profiles.instaceId=1 --server.port=8080 --spring.profiles.active=pvt NACOS-ADDR=172.17.112.126:8849
docker run -itd \
--entrypoint /bin/sh \
--volume /mnt/000.Docker/003.Lit_Information:/logs \
--add-host www.lit.redis.com:10.17.0.21 \
--add-host www.lit.nacos.com:10.17.0.21 \
--add-host www.lit.mysql.com:10.17.0.21 \
--restart always --memory 2g --user root \
--name Lit_GateWay --hostname Lit_GateWay \
-p 5005:5005 -p 10000:8080 \
hub.xxxx.com/project-name/gateway-prod:v1.24
java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -jar /Lit_Gateway.jar --server.port=8080 --spring.profiles.active=dev -NACOS-ADDR=10.17.0.21:8848
启动镜像-UAT
docker run -itd \
--entrypoint /bin/sh \
--volume /mnt/000.Docker/003.Lit_Information:/logs \
--add-host www.lit.redis.com:10.17.0.21 \
--add-host www.lit.nacos.com:10.17.0.21 \
--add-host www.lit.mysql.com:10.17.0.21 \
--add-host Lit_GateWay:10.17.0.21 \
--net=host \
--user root \
--memory 2g \
--restart always \
--name Lit_GateWay \
--hostname Lit_GateWay \
-p 5005:5005 \
-p 10000:8080 \
hub.xxxx.com/project-name/gateway-prod:v1.24
进入容器
docker exec -it Lit_GateWay /bin/sh
开启Debug
java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Xms2g -Xmx2g -Xmn1500m -Xss256k -XX:SurvivorRatio=8 -XX:ParallelGCThreads=16 -XX:CMSFullGCsBeforeCompaction=20 -XX:+UseCMSCompactAtFullCollection -XX:+PrintGCDetails -jar /Lit_manHour.jar --spring.profiles.instaceId=1 --server.port=8080 --spring.profiles.active=uat NACOS-ADDR=10.17.0.21:8848
nohup java -jar Lit_Gateway.jar > ./logs/Lit_Gateway.log &
评论区