Fix Dockerfile.test parse error in docker-test.yml workflow#686
Merged
Conversation
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Copilot
AI
changed the title
#1 [internal] load build definition from Dockerfile.test
#1 transferring dockerfile: 1.15kB done
#1 DONE 0.0s
Dockerfile.test:13
--------------------
11 | COPY pyproject.toml poetry.lock* ./
12 | RUN python -m pip install --upgrade pip whee...
Fix Dockerfile.test parse error in docker-test.yml workflow
Oct 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
docker-test.ymlGitHub Actions workflow was failing with a Dockerfile parse error:Root Cause
The workflow creates a
Dockerfile.testfile using a heredoc. Within this Dockerfile, a comment was embedded in the middle of a multi-line RUN command with backslash continuation:When a comment appears within a backslash-continued command, it breaks the continuation chain. This causes Docker to interpret
poetry install...as a separate Dockerfile instruction rather than part of the RUN command, resulting in the parse error "unknown instruction: poetry".Solution
Moved the comment to its own line before the RUN command:
This ensures the RUN command with backslash continuation is uninterrupted, allowing Docker to parse it correctly as a single instruction.
Testing
Verified that the generated Dockerfile.test now parses successfully without the "unknown instruction: poetry" error. The RUN command is properly recognized as a single multi-line instruction.
Fixes #1
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.