support multi arch build
This commit is contained in:
parent
9d76cc2074
commit
56f48b78ce
@ -80,8 +80,8 @@ inputs:
|
|||||||
description: ""
|
description: ""
|
||||||
default: "1"
|
default: "1"
|
||||||
|
|
||||||
docker_multi_arch:
|
docker_arch_list:
|
||||||
description: ""
|
description: "if set to true use linux/amd64,linux/arm64, otherwise specifiy arch list manually"
|
||||||
default: "false"
|
default: "false"
|
||||||
|
|
||||||
dockerfile:
|
dockerfile:
|
||||||
|
|||||||
12
dist/index.js
vendored
12
dist/index.js
vendored
@ -62251,6 +62251,17 @@ function prepareDockerArgs(destinations) {
|
|||||||
|
|
||||||
dockerArgs.unshift(getDockerContextDir());
|
dockerArgs.unshift(getDockerContextDir());
|
||||||
|
|
||||||
|
if (isNonEmptyStr(core.getInput('docker_arch_list'))) {
|
||||||
|
if (!core.getBooleanInput('use_buildx')) {
|
||||||
|
throw new Error('Unsupported configuration: Cannot build multiarch without enabling buildx');
|
||||||
|
}
|
||||||
|
let archList = (core.getInput('docker_arch_list'));
|
||||||
|
if (archList === 'true' || archList === '1') {
|
||||||
|
archList = 'linux/amd64,linux/arm64';
|
||||||
|
}
|
||||||
|
dockerArgs.push('--platform ' + archList);
|
||||||
|
}
|
||||||
|
|
||||||
if (core.getBooleanInput('squash_layers')) {
|
if (core.getBooleanInput('squash_layers')) {
|
||||||
dockerArgs.push('--squash');
|
dockerArgs.push('--squash');
|
||||||
}
|
}
|
||||||
@ -62300,7 +62311,6 @@ function executeDockerBuild(dockerArgs, destinations) {
|
|||||||
throw new Error('docker build failed');
|
throw new Error('docker build failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('proc error check'); // TODO remove debug
|
|
||||||
if (proc.error != null) {
|
if (proc.error != null) {
|
||||||
throw proc.error;
|
throw proc.error;
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/lib.js
12
src/lib.js
@ -149,6 +149,17 @@ export function prepareDockerArgs(destinations) {
|
|||||||
|
|
||||||
dockerArgs.unshift(getDockerContextDir());
|
dockerArgs.unshift(getDockerContextDir());
|
||||||
|
|
||||||
|
if (isNonEmptyStr(core.getInput('docker_arch_list'))) {
|
||||||
|
if (!core.getBooleanInput('use_buildx')) {
|
||||||
|
throw new Error('Unsupported configuration: Cannot build multiarch without enabling buildx');
|
||||||
|
}
|
||||||
|
let archList = (core.getInput('docker_arch_list'));
|
||||||
|
if (archList === 'true' || archList === '1') {
|
||||||
|
archList = 'linux/amd64,linux/arm64';
|
||||||
|
}
|
||||||
|
dockerArgs.push('--platform ' + archList);
|
||||||
|
}
|
||||||
|
|
||||||
if (core.getBooleanInput('squash_layers')) {
|
if (core.getBooleanInput('squash_layers')) {
|
||||||
dockerArgs.push('--squash');
|
dockerArgs.push('--squash');
|
||||||
}
|
}
|
||||||
@ -198,7 +209,6 @@ export function executeDockerBuild(dockerArgs, destinations) {
|
|||||||
throw new Error('docker build failed');
|
throw new Error('docker build failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('proc error check'); // TODO remove debug
|
|
||||||
if (proc.error != null) {
|
if (proc.error != null) {
|
||||||
throw proc.error;
|
throw proc.error;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user