Skip to content

fix: add check for missing FROM instructions in Dockerfile parsing - #950

Merged
Eljo George (eljog) merged 2 commits into
devcontainers:mainfrom
krewi1:main
Feb 28, 2025
Merged

Eljo George (eljog) merged 2 commits into
devcontainers:mainfrom
krewi1:main

Conversation

@krewi1

Copy link
Copy Markdown
Contributor

This fix ensures that the Dockerfile parser checks for the presence of at least one FROM instruction. If no FROM instructions are found, an error is thrown with a clear message, guiding the user to fix the issue by adding a valid FROM statement. This improves robustness and helps users quickly identify and resolve misconfigured or incomplete Dockerfiles.

@krewi1
Pavel Kratochvil (krewi1) requested a review from a team as a code owner January 30, 2025 11:47
@krewi1

Pavel Kratochvil (krewi1) commented Jan 30, 2025 •

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@chrmarti Christof Marti (chrmarti) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@eljog
Eljo George (eljog) enabled auto-merge (squash) February 28, 2025 21:44
@eljog
Eljo George (eljog) merged commit 016704a into devcontainers:main Feb 28, 2025
@felipecrs

Copy link
Copy Markdown

Unfortunately this PR actually prevents a legit use case #991.

IMO using docker build --check would make better sense than implementing its own checker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants