You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 834bf15
Browse filesBrowse the repository at this point in the historyBrowse files
fix(docker): keep the stage name of a continued final FROM line
TS ensureDockerfileHasFinalStageName reads only the physical last FROM
line, so `FROM \` followed by `alpine AS base` becomes `FROM \ AS dev`,
a Dockerfile no builder accepts. Ask BuildKit for that stage's name
instead; every other FROM line keeps TS's handling. The ts-oracle golden
records TS's answer as a divergence case, and docs/DIVERGENCES.md
explains it. A `# escape=` directive now follows TS too, also recorded
in the golden.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: internal/docker/testdata/ts-oracle/dockerfile.json
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -885,6 +885,30 @@
885
885
"ref=x,type=registry,mode=inline"
886
886
],
887
887
"result": false
888
+
},
889
+
{
890
+
"name": "continued FROM line",
891
+
"fn": "ensureDockerfileHasFinalStageName",
892
+
"args": [
893
+
"FROM \\\n alpine:3.20 AS base\n",
894
+
"dev"
895
+
],
896
+
"divergence": "docs/DIVERGENCES.md: a FROM line continued with a backslash keeps its stage name (TS writes \" AS <name>\" after the backslash, which no builder accepts)",
897
+
"result": {
898
+
"lastStageName": "dev",
899
+
"modifiedDockerfile": "FROM \\ AS dev\n alpine:3.20 AS base\n"
0 commit comments