RainBond environment - Obtain the local IP address in the Docker container

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
image.png
, 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

Guess you like

Origin blog.csdn.net/u012383839/article/details/131889844