Run buildah config command before copy command

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
divyansh42 2021-09-02 15:37:42 +05:30
parent a9a026b165
commit 09f51f8381
4 changed files with 4 additions and 5 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -23,8 +23,8 @@ interface Buildah {
useOCI: boolean, arch: string, layers: string, extraArgs: string[] useOCI: boolean, arch: string, layers: string, extraArgs: string[]
): Promise<CommandResult>; ): Promise<CommandResult>;
from(baseImage: string): Promise<CommandResult>; from(baseImage: string): Promise<CommandResult>;
copy(container: string, contentToCopy: string[]): Promise<CommandResult | undefined>;
config(container: string, setting: BuildahConfigSettings): Promise<CommandResult>; config(container: string, setting: BuildahConfigSettings): Promise<CommandResult>;
copy(container: string, contentToCopy: string[]): Promise<CommandResult | undefined>;
commit(container: string, newImageName: string, useOCI: boolean): Promise<CommandResult>; commit(container: string, newImageName: string, useOCI: boolean): Promise<CommandResult>;
} }

View file

@ -99,8 +99,6 @@ async function doBuildFromScratch(
const container = await cli.from(baseImage); const container = await cli.from(baseImage);
const containerId = container.output.replace("\n", ""); const containerId = container.output.replace("\n", "");
await cli.copy(containerId, content);
const newImageConfig: BuildahConfigSettings = { const newImageConfig: BuildahConfigSettings = {
entrypoint, entrypoint,
port, port,
@ -109,6 +107,7 @@ async function doBuildFromScratch(
arch, arch,
}; };
await cli.config(containerId, newImageConfig); await cli.config(containerId, newImageConfig);
await cli.copy(containerId, content);
await cli.commit(containerId, newImage, useOCI); await cli.commit(containerId, newImage, useOCI);
} }