background
The project uses RainBond to build and deploy cloud-native applications, but the project needs to obtain the local IP address at startup.
solve
Scenario 1: RainBond environment variables
From the perspective of RainBond, it is found that the preset environment variable is directly used: POD_IP
advanced environment variable configuration | Rainbond
, so the local IP address can be obtained through $POD_IP directly when java -jar is started.
Scenario 2: Generic shell script
The general shell steps are as follows:
1. Modify the base image, install