mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 09:01:23 +00:00
Fix: platform parameter is not supported by buildah config (build-without-containerfile)
Signed-off-by: James Addison <jay@jp-hosting.net>
This commit is contained in:
parent
733d8e9a38
commit
0fa92aa498
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 |
|
| 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)
|
| 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**
|
| 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
|
| 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
|
| 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.'
|
description: 'Alias for "arch". "arch" takes precedence if both are set.'
|
||||||
required: false
|
required: false
|
||||||
platform:
|
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
|
required: false
|
||||||
extra-args:
|
extra-args:
|
||||||
description: |
|
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;
|
port?: string;
|
||||||
workingdir?: string;
|
workingdir?: string;
|
||||||
arch?: string;
|
arch?: string;
|
||||||
platform?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Buildah {
|
interface Buildah {
|
||||||
|
@ -140,10 +139,6 @@ export class BuildahCli implements Buildah {
|
||||||
args.push("--arch");
|
args.push("--arch");
|
||||||
args.push(settings.arch);
|
args.push(settings.arch);
|
||||||
}
|
}
|
||||||
if (settings.platform) {
|
|
||||||
args.push("--platform");
|
|
||||||
args.push(settings.platform);
|
|
||||||
}
|
|
||||||
if (settings.workingdir) {
|
if (settings.workingdir) {
|
||||||
args.push("--workingdir");
|
args.push("--workingdir");
|
||||||
args.push(settings.workingdir);
|
args.push(settings.workingdir);
|
||||||
|
|
|
@ -87,6 +87,7 @@ export enum Inputs {
|
||||||
OCI = "oci",
|
OCI = "oci",
|
||||||
/**
|
/**
|
||||||
* Label the image with this PLATFORM, instead of defaulting to the host platform.
|
* Label the image with this PLATFORM, instead of defaulting to the host platform.
|
||||||
|
* Only supported for containerfile builds.
|
||||||
* Required: false
|
* Required: false
|
||||||
* Default: None.
|
* Default: None.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -64,7 +64,10 @@ export async function run(): Promise<void> {
|
||||||
await doBuildUsingContainerFiles(cli, newImage, workspace, containerFiles, useOCI, arch, platform);
|
await doBuildUsingContainerFiles(cli, newImage, workspace, containerFiles, useOCI, arch, platform);
|
||||||
}
|
}
|
||||||
else {
|
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) {
|
if (tagsList.length > 1) {
|
||||||
|
@ -105,7 +108,7 @@ async function doBuildUsingContainerFiles(
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doBuildFromScratch(
|
async function doBuildFromScratch(
|
||||||
cli: BuildahCli, newImage: string, useOCI: boolean, arch: string, platform: string
|
cli: BuildahCli, newImage: string, useOCI: boolean, arch: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
core.info(`Performing build from scratch`);
|
core.info(`Performing build from scratch`);
|
||||||
|
|
||||||
|
@ -125,7 +128,6 @@ async function doBuildFromScratch(
|
||||||
workingdir: workingDir,
|
workingdir: workingDir,
|
||||||
envs,
|
envs,
|
||||||
arch,
|
arch,
|
||||||
platform,
|
|
||||||
};
|
};
|
||||||
await cli.config(containerId, newImageConfig);
|
await cli.config(containerId, newImageConfig);
|
||||||
await cli.copy(containerId, content);
|
await cli.copy(containerId, content);
|
||||||
|
|
Loading…
Reference in a new issue