Avoid using EXPOSE directive for optional ports#20
Open
Conversation
The idea is to prevent false positives when listing containers: #18 (comment) Changes originally submitted by @alastair at: #18 (comment)
To follow the previous commit, it makes explicit that only mandatory ports should be exposed through the EXPOSE directive, so as to avoid false positives when listing containers.
alastair
approved these changes
Jan 31, 2023
Contributor
alastair
left a comment
There was a problem hiding this comment.
I made some suggestions to the grammar, which I hope maintains the original meaning that you wanted to portray
Comment on lines
+7
to
+10
| with mandatory ports only, | ||
| to document which ports the services are necessarily listening to. If the image will be used to run many | ||
| containers, some of which don't listen on a port, instead use the `expose` option in | ||
| `docker-compose.yml` (see the below section for details) or the `--expose` flag to `docker run`. |
Contributor
There was a problem hiding this comment.
Suggested change
| with mandatory ports only, | |
| to document which ports the services are necessarily listening to. If the image will be used to run many | |
| containers, some of which don't listen on a port, instead use the `expose` option in | |
| `docker-compose.yml` (see the below section for details) or the `--expose` flag to `docker run`. | |
| only when **all** containers using this image will listen on that port, to document that all services | |
| will be listening on that port. If the image will be used to run many | |
| containers, some of which don't listen on a port, instead use the `expose` option in | |
| `docker-compose.yml` (see the below section for details) or the `--expose` flag to `docker run` | |
| on only the containers which listen on the port. |
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.
It follows #18 (review).