mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-15 07:21:23 +00:00
Fix: platform parameter is not supported by buildah config (build-without-containerfile) (#83)
Signed-off-by: James Addison <jay@jp-hosting.net>
This commit is contained in:
parent
733d8e9a38
commit
bb88487cd2
7 changed files with 11 additions and 12 deletions
|
@ -45,7 +45,6 @@ After building your image, use [push-to-registry](https://github.com/redhat-acti
|
|||
| Input Name | Description | Default |
|
||||
| ---------- | ----------- | ------- |
|
||||
| arch | Label the image with this architecture, instead of defaulting to the host architecture. Refer to [Multi arch builds](#multi-arch-builds) for more information. | None (host architecture)
|
||||
| platform | Label the image with this platform, instead of defaulting to the host platform. Refer to [Multi arch builds](#multi-arch-builds) for more information. | None (host platform)
|
||||
| base-image | The base image to use for the container. | **Required**
|
||||
| content | Paths to files or directories to copy inside the container to create the file image. This is a multiline input to allow you to copy multiple files/directories.| None
|
||||
| entrypoint | The entry point to set for the container. Separate arguments by newline. | None
|
||||
|
|
|
@ -57,7 +57,9 @@ inputs:
|
|||
description: 'Alias for "arch". "arch" takes precedence if both are set.'
|
||||
required: false
|
||||
platform:
|
||||
description: 'Label the image with this PLATFORM, instead of defaulting to the host platform.'
|
||||
description: |
|
||||
Label the image with this PLATFORM, instead of defaulting to the host platform.
|
||||
Only supported for containerfile builds.
|
||||
required: false
|
||||
extra-args:
|
||||
description: |
|
||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -15,7 +15,6 @@ export interface BuildahConfigSettings {
|
|||
port?: string;
|
||||
workingdir?: string;
|
||||
arch?: string;
|
||||
platform?: string;
|
||||
}
|
||||
|
||||
interface Buildah {
|
||||
|
@ -140,10 +139,6 @@ 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);
|
||||
|
|
|
@ -87,6 +87,7 @@ export enum Inputs {
|
|||
OCI = "oci",
|
||||
/**
|
||||
* Label the image with this PLATFORM, instead of defaulting to the host platform.
|
||||
* Only supported for containerfile builds.
|
||||
* Required: false
|
||||
* Default: None.
|
||||
*/
|
||||
|
|
|
@ -64,7 +64,10 @@ export async function run(): Promise<void> {
|
|||
await doBuildUsingContainerFiles(cli, newImage, workspace, containerFiles, useOCI, arch, platform);
|
||||
}
|
||||
else {
|
||||
await doBuildFromScratch(cli, newImage, useOCI, arch, platform);
|
||||
if (platform) {
|
||||
throw new Error("The --platform option is not supported for builds without containerfiles.");
|
||||
}
|
||||
await doBuildFromScratch(cli, newImage, useOCI, arch);
|
||||
}
|
||||
|
||||
if (tagsList.length > 1) {
|
||||
|
@ -105,7 +108,7 @@ async function doBuildUsingContainerFiles(
|
|||
}
|
||||
|
||||
async function doBuildFromScratch(
|
||||
cli: BuildahCli, newImage: string, useOCI: boolean, arch: string, platform: string
|
||||
cli: BuildahCli, newImage: string, useOCI: boolean, arch: string
|
||||
): Promise<void> {
|
||||
core.info(`Performing build from scratch`);
|
||||
|
||||
|
@ -125,7 +128,6 @@ async function doBuildFromScratch(
|
|||
workingdir: workingDir,
|
||||
envs,
|
||||
arch,
|
||||
platform,
|
||||
};
|
||||
await cli.config(containerId, newImageConfig);
|
||||
await cli.copy(containerId, content);
|
||||
|
|
Loading…
Reference in a new issue