Skip to content

Commit cccd1ec

Browse files
committed
Re-add tar to dereference symlinks
1 parent 1d01ba3 commit cccd1ec

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

deploy/docker/create-docker-context.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ if (argv.build) {
156156
wrapConsoleOutput(dockerPullProcess);
157157
}
158158

159+
const tarProcess = childProcess.spawn(
160+
tar,
161+
[...extraParameters, "--dereference", "-czf", "-", "*"],
162+
{
163+
cwd: dockerContextDir,
164+
stdio: ["inherit", "pipe", "inherit"],
165+
env: env,
166+
shell: true
167+
}
168+
);
169+
159170
const tags = getTags(
160171
argv.tag,
161172
argv.local,
@@ -180,11 +191,11 @@ if (argv.build) {
180191
...(argv.noCache ? ["--no-cache"] : []),
181192
...(argv.platform ? ["--platform", argv.platform, "--push"] : []),
182193
"-f",
183-
path.resolve(componentDestDir, "Dockerfile"),
184-
dockerContextDir
194+
"./component/Dockerfile",
195+
"-"
185196
],
186197
{
187-
stdio: ["inherit", "inherit", "inherit"],
198+
stdio: ["pipe", "inherit", "inherit"],
188199
env: env
189200
}
190201
);
@@ -213,6 +224,14 @@ if (argv.build) {
213224
}
214225
process.exit(code);
215226
});
227+
228+
tarProcess.on("close", (code) => {
229+
dockerProcess.stdin.end();
230+
});
231+
232+
tarProcess.stdout.on("data", (data) => {
233+
dockerProcess.stdin.write(data);
234+
});
216235
} else if (argv.output) {
217236
const outputPath = path.resolve(process.cwd(), argv.output);
218237

0 commit comments

Comments
 (0)