同一物理机Docker运行多个Dubbo不同端口

application.properties

SERVER_PORT从系统环境变量中获取,默认值为301

## Web Port
server.port=${SERVER_PORT:301}
...
## Dubbo Port
dubbo.protocol.port=30001

Docker

sudo docker run -d --name rx_tech_jmqtt_service \
--net=host \
-e SERVER_PORT=301 \
-v /home/xujian/packages/rx_tech_jmqtt_service:/app \
-v /etc/localtime:/etc/localtime \
java:8 java \
-Djava.security.egd=file:/dev/./urandom \
-Ddubbo.protocol.port=30001 \
-jar /app/rx_tech_jmqtt_service-0.0.1-SNAPSHOT.jar

你可能感兴趣的:(同一物理机Docker运行多个Dubbo不同端口)