Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive error message Invalid containerPort: ... #167

Closed
31z4 opened this issue Nov 11, 2017 · 8 comments
Closed

False positive error message Invalid containerPort: ... #167

31z4 opened this issue Nov 11, 2017 · 8 comments

Comments

@31z4
Copy link

31z4 commented Nov 11, 2017

Having the following Dockerfile

FROM openjdk:8-jre-alpine
ENV ZOO_PORT=2181
EXPOSE $ZOO_PORT

I get an error message Invalid containerPort: $ZOO_PORT which is incorrect, since environment variables are supported by the following list of instructions in the Dockerfile:

  • ADD
  • COPY
  • ENV
  • EXPOSE
  • FROM
  • LABEL
  • STOPSIGNAL
  • USER
  • VOLUME
  • WORKDIR
    as well as:
  • ONBUILD (when combined with one of the supported instructions above)
@rcjsuen
Copy link
Contributor

rcjsuen commented Nov 11, 2017

Thank you very much for your bug report, @31z4. I have opened rcjsuen/dockerfile-language-server#192 to track this problem in the language server.

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 11, 2018

This can be closed since #173 has been merged.

@chemidy
Copy link

chemidy commented Jan 16, 2018

With the last version 0.0.23, it's not resolved.

[dockerfile-lsp] Invalid containerPort:

FROM scratch
ARG GRPC_PORT
EXPOSE $ZOO_PORT

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 16, 2018

Hi @chemidy, if you use the Dockerfile that was originally posted, you shouldn't get any errors.

In the Dockerfile you have provided, you defined an argument named GRPC_PORT but your EXPOSE instruction is using $ZOO_PORT. Did you make a copy/paste error? Is this the Dockerfile you intended to write in your comment?

FROM scratch
ARG GRPC_PORT
EXPOSE $GRPC_PORT

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 16, 2018

In any case, I have opened rcjsuen/dockerfile-language-server#199 for the problem that you have found regarding build arguments with no default values.

Thank you for the bug report!

@chemidy
Copy link

chemidy commented Jan 16, 2018

Hi @rcjsuen , yes it was a copy/paste error. Thks for the bug report

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 19, 2018

@chemidy Thanks again for the bug report. I've published a new version of the language server to npm and updated #198 to include the new release.

@rcjsuen
Copy link
Contributor

rcjsuen commented Feb 3, 2018

@chemidy Please update to 0.0.24 for a fix to the problem you reported. Thanks again for the bug report!

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants