fix(evals): build /run.sh with printf so legacy builder works#2779
Merged
Conversation
The Dockerfile.template used a BuildKit heredoc (`RUN cat <<-'EOF' >/run.sh`). With the legacy builder it parses as `RUN cat >/run.sh` — empty stdin, 0-byte file. Every eval container then dies with `exec /run.sh: exec format error`, emits no events, and the run ends with Total Cost=$0 / Errors=N/N. Replace the heredoc with a single `RUN printf … > /run.sh && chmod +x`. Same resulting file, works on both legacy builder and BuildKit.
melmennaoui
approved these changes
May 13, 2026
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
This is a clean, well-scoped fix. The heredoc → printf replacement correctly addresses the legacy builder compatibility issue described in the PR. No bugs were found in the changed code.
Summary of changes reviewed:
pkg/evaluation/Dockerfile.template: Replaces a BuildKit-only heredoc with a POSIX-compatibleprintfcommand to write/run.sh, ensuring the file is populated correctly when the legacy builder is used.
The fix is byte-identical in output to the original heredoc under BuildKit, and the added chmod +x is a safe no-op on a file that was already executable under the heredoc approach.
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.
Summary
pkg/evaluation/Dockerfile.templateused a BuildKit heredoc to write/run.sh:Heredocs require BuildKit. When the build runs against the legacy builder, this is parsed as just
RUN cat >/run.sh—catreads from empty stdin and produces a zero-byte/run.sh. The subsequent heredoc body lines are treated as standalone Dockerfile instructions; Docker is lenient and the build "succeeds" with/run.shempty but executable.Replaced with a single
printfthat works on both legacy and BuildKit builders:Resulting
/run.shis byte-identical to what the heredoc produces under BuildKit.