Issue 1255 server port sb fix#1256
Open
stokpop wants to merge 3 commits intocloudfoundry:mainfrom
Open
Conversation
Apps with server.port set in application.yml would bind to the wrong port at startup, causing CF health checks to fail. Apps with a privileged port (< 1024, e.g. 443) would crash immediately with java.net.BindException: Permission denied. Mirrors the Ruby buildpack behaviour in spring_boot.rb release(). Fixes cloudfoundry#1255
…runtime WriteEnvFile writes the literal string "$PORT" to deps/0/env/SERVER_PORT. CF's launcher reads env files as plain text (no shell expansion), so Spring Boot received the literal string "$PORT" as the port, which is invalid and ignored, leaving server.port from application.yml in effect. Replace with WriteProfileD which writes a bash profile.d script that is *sourced* at container start — so $PORT is expanded to the actual CF-assigned port number before Spring Boot initialises its embedded server. This fixes: - apps binding to a hardcoded port instead of the CF-assigned $PORT - java.net.BindException: Permission denied for privileged ports (e.g. 443)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1255