From 9800e37cd65438cc99163bc4bb5cf4e3e22352f7 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Thu, 28 May 2026 22:35:47 +0200 Subject: [PATCH] fix: use single backslash for Dockerfile line continuations The compile_dockerfile function used \\\\ in Python string literals, which produces \ (two backslashes) in the Dockerfile output. Docker's legacy builder requires a single backslash \ for line continuation. This caused 'unknown instruction: curl' because Docker saw the first as the continuation and the second \ as a literal character before the newline, breaking the RUN command parsing. Fix: change all \\ to \ in Python string literals within compile_dockerfile, producing the correct single-backslash continuation. Verified with hex dump from container logs: - Before: line ended with 5c5c (two backslashes) - After: line ends with 5c (one backslash) --- apps/api/src/services/manifest_compiler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/src/services/manifest_compiler.py b/apps/api/src/services/manifest_compiler.py index a9ec9bb..e155c64 100644 --- a/apps/api/src/services/manifest_compiler.py +++ b/apps/api/src/services/manifest_compiler.py @@ -117,10 +117,10 @@ def compile_dockerfile(manifest: dict) -> str: # System packages (apt) apt_packages = manifest.get("packages", {}).get("apt", []) if apt_packages: - lines.append("RUN apt-get update && apt-get install -y \\\\") + lines.append("RUN apt-get update && apt-get install -y \\") for pkg in apt_packages[:-1]: - lines.append(f" {pkg} \\\\") - lines.append(f" {apt_packages[-1]} \\\\") + lines.append(f" {pkg} \\") + lines.append(f" {apt_packages[-1]} \\") lines.append(" && rm -rf /var/lib/apt/lists/*") lines.append("") @@ -129,9 +129,9 @@ def compile_dockerfile(manifest: dict) -> str: if node: version = node.get("version", "20") lines.append( - f"RUN curl -fsSL https://deb.nodesource.com/setup_{version}.x | bash - && \\\\" + f"RUN curl -fsSL https://deb.nodesource.com/setup_{version}.x | bash - && \\" ) - lines.append(" apt-get install -y nodejs && \\\\") + lines.append(" apt-get install -y nodejs && \\") lines.append(" rm -rf /var/lib/apt/lists/*") lines.append("") @@ -157,7 +157,7 @@ def compile_dockerfile(manifest: dict) -> str: gid = user["gid"] create_home = "-m " if user.get("create_home", True) else "" shell = user.get("shell", "/bin/bash") - lines.append(f"RUN groupadd -g {gid} {name} && \\\\") + lines.append(f"RUN groupadd -g {gid} {name} && \\") lines.append(f" useradd -u {uid} -g {gid} {create_home}-s {shell} {name}") lines.append("")