Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Browser profiler use headless=new #94

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor more args
soundofspace committed May 31, 2024
commit 351f9c59d9144b86e2fbb062c55da22274e0b9b0
11 changes: 10 additions & 1 deletion browser-profiler/main/lib/local-tooling/DockerUtils.ts
Original file line number Diff line number Diff line change
@@ -9,7 +9,16 @@ export function buildChromeDocker(version: string, chromeUrl: string): string {
const dockerName = `chromes-${version}`;
console.log(chromeUrl);
const chromeFolder = chromeUrl.match(/chrome_(.+)_linux.tar.gz$/)[1];
const command = `docker build --platform linux/amd64 --build-arg chrome_url="${chromeUrl}" --build-arg chrome_folder="${chromeFolder}" -f "Dockerfile-linux" -t "${dockerName}" .`;
const dockerArgs = [
`--build-arg chrome_url="${chromeUrl}"`,
`--build-arg chrome_folder="${chromeFolder}"`,
'-f "Dockerfile-linux"',
`-t "${dockerName}"`,
];
if (process.platform === 'darwin') {
dockerArgs.push('--platform=linux/amd64');
}
const command = `docker build ${dockerArgs.join(' ')} .`;
console.log(command);
execSync(command, { stdio: 'inherit', cwd: dockerWorkingDirectory });
return dockerName;