This commit is contained in:
+6
-2
@@ -69,8 +69,12 @@ async function followBuild(stream) {
|
||||
|
||||
console.log(`Building ${image}`);
|
||||
const context = tar.pack(process.cwd(), {
|
||||
ignore: (name) => [".git", "node_modules", ...usePrebuiltOutput ? [] : [".next"]]
|
||||
.some((part) => name === part || name.includes(`/${part}/`)),
|
||||
ignore: (name) => {
|
||||
const relative = name.replace(/^\.\//, "");
|
||||
if (relative === ".git" || relative.startsWith(".git/")) return true;
|
||||
if (relative === "node_modules" || relative.startsWith("node_modules/")) return true;
|
||||
return !usePrebuiltOutput && (relative === ".next" || relative.startsWith(".next/"));
|
||||
},
|
||||
});
|
||||
await followBuild(await docker.buildImage(context, { t: image, dockerfile }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user