Skip to content

Commit

Permalink
[build] Run docker architecture builds in paralle
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed May 13, 2024
1 parent af91e55 commit 331d17d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions src/dev/build/tasks/os_packages/create_os_package_tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,24 @@ export const CreateDockerServerless: Task = {
description: 'Creating Docker Serverless image',

async run(config, log, build) {
await runDockerGenerator(config, log, build, {
architecture: 'x64',
baseImage: 'ubuntu',
context: false,
serverless: true,
image: true,
dockerBuildDate,
});
await runDockerGenerator(config, log, build, {
architecture: 'aarch64',
baseImage: 'ubuntu',
context: false,
serverless: true,
image: true,
dockerBuildDate,
});
await Promise.all([
runDockerGenerator(config, log, build, {
architecture: 'x64',
baseImage: 'ubuntu',
context: false,
serverless: true,
image: true,
dockerBuildDate,
}),
runDockerGenerator(config, log, build, {
architecture: 'aarch64',
baseImage: 'ubuntu',
context: false,
serverless: true,
image: true,
dockerBuildDate,
}),
]);
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function generator({
const dockerTargetName = `${imageTag}${imageFlavor}:${tag}`;
const dockerArchitecture = architecture === 'aarch64' ? 'linux/arm64' : 'linux/amd64';
const dockerBuild = dockerCrossCompile
? `docker buildx build --platform ${dockerArchitecture} -t ${dockerTargetName} -f Dockerfile . || exit 1;`
: `docker build -t ${dockerTargetName} -f Dockerfile . || exit 1;`;
? `docker buildx build --quiet --platform ${dockerArchitecture} -t ${dockerTargetName} -f Dockerfile . || exit 1;`
: `docker build --quiet -t ${dockerTargetName} -f Dockerfile . || exit 1;`;
return dedent(`
#!/usr/bin/env bash
#
Expand Down

0 comments on commit 331d17d

Please sign in to comment.