mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-06-08 01:49:03 +00:00
Add support for 'platform' parameter (#75)
Signed-off-by: James Addison <jay@jp-hosting.net>
This commit is contained in:
parent
979e6a6c6e
commit
3bb95d0042
9 changed files with 119 additions and 21 deletions
|
@ -15,12 +15,13 @@ export interface BuildahConfigSettings {
|
|||
port?: string;
|
||||
workingdir?: string;
|
||||
arch?: string;
|
||||
platform?: string;
|
||||
}
|
||||
|
||||
interface Buildah {
|
||||
buildUsingDocker(
|
||||
image: string, context: string, containerFiles: string[], buildArgs: string[],
|
||||
useOCI: boolean, arch: string, layers: string, extraArgs: string[]
|
||||
useOCI: boolean, arch: string, platform: string, layers: string, extraArgs: string[]
|
||||
): Promise<CommandResult>;
|
||||
from(baseImage: string): Promise<CommandResult>;
|
||||
config(container: string, setting: BuildahConfigSettings): Promise<CommandResult>;
|
||||
|
@ -63,13 +64,17 @@ export class BuildahCli implements Buildah {
|
|||
|
||||
async buildUsingDocker(
|
||||
image: string, context: string, containerFiles: string[], buildArgs: string[],
|
||||
useOCI: boolean, arch: string, layers: string, extraArgs: string[]
|
||||
useOCI: boolean, arch: string, platform: string, layers: string, extraArgs: string[]
|
||||
): Promise<CommandResult> {
|
||||
const args: string[] = [ "bud" ];
|
||||
if (arch) {
|
||||
args.push("--arch");
|
||||
args.push(arch);
|
||||
}
|
||||
if (platform) {
|
||||
args.push("--platform");
|
||||
args.push(platform);
|
||||
}
|
||||
containerFiles.forEach((file) => {
|
||||
args.push("-f");
|
||||
args.push(file);
|
||||
|
@ -135,6 +140,10 @@ export class BuildahCli implements Buildah {
|
|||
args.push("--arch");
|
||||
args.push(settings.arch);
|
||||
}
|
||||
if (settings.platform) {
|
||||
args.push("--platform");
|
||||
args.push(settings.platform);
|
||||
}
|
||||
if (settings.workingdir) {
|
||||
args.push("--workingdir");
|
||||
args.push(settings.workingdir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue