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

Update Dockerfile language server to 0.11.0 #4065

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

rcjsuen
Copy link
Contributor

@rcjsuen rcjsuen commented Sep 10, 2023

This update adds support for a few new flags that have been added to Dockerfile so that they no longer get flagged as errors. The other big change is the introduction of a comment that can be inserted into the Dockerfile to instruct the linter to not flag something as an error. While most errors can be ignored this way, clearly fatal errors that suggest the Dockerfile is completely broken cannot be ignored.

This release fixes the following issues. As always, thank you all for your bug reports and suggestions!

Please use the following Dockerfile to test the new features and bug fixes.

FROM scratch
# 1. Use code completion at the end. You should now see --start-interval and --start-period.
HEALTHCHECK --start-
# 2. --start-interval used to be flagged as an error. This has been fixed.
# 3. (Issue #4054) Hover over --start-interval and you will get hover documentation help.
HEALTHCHECK --start-interval=5s CMD ls

# 4. You can now use a comment like the above to stop flagging an error.
# Now you can rid yourself of errors without having to wait for me to push out a fix first!
# dockerfile-utils: ignore
UNKNOWN instruction

# Note that the comment must be before the instruction itself rather than the line immediately before the error itself.
# In this case the comment being on line 20 means it will not take effect. Move it to up to before the HEALTHCHECK and it will work.
# Most errors can be ignored but clearly fatal errors (missing FROM) cannot be ignored.

HEALTHCHECK \
    --interval=30s \
    --retries=3 \
    # dockerfile-utils: ignore
    --start-interval-typo=5s \
    --start-period=5s \
    --timeout=30s \
    CMD ls

# 5. (Issue #4051) --checksum is now supported and no longer flagged as an error.
ADD --checksum=sha256:24454f830cdb571e2c4ad15481119c43b3cafd48dd869a9b2945d1036d1dc68d https://mirrors.edge.kernel.org/pub/linux/kernel/Historic/linux-0.01.tar.gz /
# 6. --keep-git-dir is now supported and no longer flagged as an error.
ADD --keep-git-dir=true https://github.com/moby/buildkit.git#v0.10.1 /buildkit

# 7. (Issue #4012) Predefined ARG variables are now assumed to be okay for FROM instructions.
FROM ${TARGETARCH}

# 8. (Issue #4056) The parser now parses tags with digests better. The link should now open correctly instead of going to a 404.
FROM microsoft/dotnet:non-existent-tag@sha256:5483e2b609c0f66c3ebd96666de7b0a74537613b43565879ecb0d0a73e845d7d

This update adds support for a few new flags that have been added to
Dockerfile so that they no longer get flagged as errors. The other big
change is the introduction of a comment that can be inserted into the
Dockerfile to instruct the linter to not flag something as an error.
While most errors can be ignored this way, clearly fatal errors that
suggest the Dockerfile is completely broken cannot be ignored.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
Copy link
Member

@alexyaang alexyaang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcjsuen Awesome work, Remy! :) Thank you for your contribution as always.

@alexyaang alexyaang merged commit fe82b63 into microsoft:main Sep 19, 2023
2 checks passed
@rcjsuen rcjsuen deleted the dockerfile-language-server-0.11.0 branch September 19, 2023 17:08
@rcjsuen
Copy link
Contributor Author

rcjsuen commented Sep 19, 2023

@alexyaang Thanks for the review and for merging this in! Have a nice day! 👍

@microsoft microsoft locked and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants