Vscode-docker: Is Empty PORT EXPOSE By Design

Created on 22 Aug 2018  ·  3Comments  ·  Source: microsoft/vscode-docker

I was generating a Dockerfile with the > Dockerfile command, and decided to leave the PORT section as an empty string, as I'm generating a base image that doesn't require exposing. This is what is generated
screen shot 2018-08-22 at 14 37 00

I know it's as easy as just deleting the last line, but I'm wondering if this is by design, or if someone doesn't specify a port, EXPOSE should not be generated.

bug

All 3 comments

Ideally we will not add the EXPOSE if port is empty.

Need to deal with compose files, too.

Moving forward we won't be generating dockerfiles with empty expose statements. It's easy to delete them manually.

Was this page helpful?
0 / 5 - 0 ratings