Skip to content

Conversation

@nvdk
Copy link
Member

@nvdk nvdk commented May 5, 2022

I was kind of surprised we didn't have this in here already.
the docker reference specifies this is mostly for documentation towards users of a microservice. I think it's valuable to make it clear that microservices based on the template listen on port 80. Exposed ports are also used by other "proxy type" microservices such as the letsencrypt companion to figure out how to forward calls to the container in question.

From the reference:

The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. You can specify whether the port listens on TCP or UDP, and the default is TCP if the protocol is not specified.

The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. To actually publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports.

I was kind of surprised we didn't have this in here already. 
the [docker reference](https://docs.docker.com/engine/reference/builder/#expose) specifies this is mostly for documentation towards users of a microservice. I think it's valuable to make it clear that microservices based on the template listen on port 80. Exposed ports are  also used by other "proxy type" microservices such as the letsencrypt companion to figure out how to forward calls to the container in question.

From the reference:
> The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. You can specify whether the port listens on TCP or UDP, and the default is TCP if the protocol is not specified.

> The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. To actually publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports.
@erikap erikap merged commit d3281b8 into mu-semtech:master Aug 8, 2022
@nvdk nvdk deleted the patch-2 branch September 13, 2022 07:58
elpoelma pushed a commit that referenced this pull request Feb 28, 2023
* add expose statement (#39)

I was kind of surprised we didn't have this in here already. 
the [docker reference](https://docs.docker.com/engine/reference/builder/#expose) specifies this is mostly for documentation towards users of a microservice. I think it's valuable to make it clear that microservices based on the template listen on port 80. Exposed ports are  also used by other "proxy type" microservices such as the letsencrypt companion to figure out how to forward calls to the container in question.

From the reference:
> The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. You can specify whether the port listens on TCP or UDP, and the default is TCP if the protocol is not specified.

> The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. To actually publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports.

* Allow overriding port and hostname (#47)

* Allow overriding port and hostname

* Update server.js

* Update Dockerfile

* instructions on handling delta's in a JS service (#48)

* Add documentation to allow overriding port and hostname (#49)

* Allow overriding port and hostname

* Update server.js

* Update Dockerfile

* Update Dockerfile

* Update README.md

---------

Co-authored-by: Niels V <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants