arm容器启动spring-boot端口报错
问题描述:
2025-08-31T14:38:31.206+08:00 ERROR 1 --- [spring-boot-nginx-test] [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Invalid value 'tcp://192.168.180.154:8091' for configuration property 'server.port' (originating from 'System Environment Property "SERVER_PORT"'). Validation failed for the following reason:
Failed to convert to type java.lang.Integer
Additionally, this property is also set in the following property source:
- In 'Config resource 'file [config/application.yaml]' via location 'optional:file:./config/'' with the value '8080' (originating from 'URL [file:config/application.yaml] - 10:9').
Action:
Review the value of the property with the provided reason.
解决:
server.port=8080
management.server.port=8081
apiVersion: apps/v1 kind: Deployment metadata:name: spring-boot-nginx-testnamespace: devlabels: app: spring-boot-nginx-test spec: replicas: 1selector:matchLabels:app: spring-boot-nginx-testtemplate:metadata:labels:app: spring-boot-nginx-testspec:containers:- name: spring-boot-nginx-testimage: spring-boot-nginx-testimagePullPolicy: IfNotPresentenv:- name: SERVER_PORTvalue: "8080"- name: MANAGEMENT_SERVER_PORTvalue: "8081"- name: "JAVA_OPT"value: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9527"ports:- name: httpcontainerPort: 8080protocol: TCP- name: debugcontainerPort: 9527protocol: TCPvolumeMounts:- name: datemountPath: /etc/localtimevolumes:- name: datehostPath:path: /etc/localtime --- apiVersion: v1 kind: Service metadata:name: spring-boot-nginx-testnamespace: devlabels:app: spring-boot-nginx-test spec:type: NodePortports:- name: httpport: 8080targetPort: 8080- name: debugport: 9527targetPort: 9527selector:app: spring-boot-nginx-test