fix: Use addExposedPort instead of setExposedPort which overrides user configuration #171
+38
−6
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.
…r configuration
Currently it is impossible to configure SSL, rather than go through all the hoops to add proper configuration for SSL I've applied this hotfix. By using addExposedPort we do not override the user configuration. Currently if I was to do the following:
This would never bind 8443 because when the container is started the configure also calls withExposedPorts, therefore overriding the user configured values.
This means we cannot configure SSL as we need a port for HTTP and HTTPS.
For testing I simply exposed an additional port to test that this would no longer override that port - this test if tried without the code change will fail. This confirms that the code is working as expected.
References
#164
Submitter checklist
#help-contributing
or a project-specific channel like#wiremock-java