From d4577a64b2936ec0ac1e3b3f6f5f323afc84938f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 5 Oct 2020 20:19:21 +0200 Subject: [PATCH] Temporarly set buildkit container image to moby/buildkit:v0.8-beta Signed-off-by: CrazyMax --- dist/index.js | 20 +++++++++++++++----- src/main.ts | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index c0fcc01..d7a5480 100644 --- a/dist/index.js +++ b/dist/index.js @@ -525,11 +525,21 @@ function run() { if (inputs.driver !== 'docker') { core.info('🔨 Creating a new builder instance...'); let createArgs = ['buildx', 'create', '--name', builderName, '--driver', inputs.driver]; - yield context.asyncForEach(inputs.driverOpts, (driverOpt) => __awaiter(this, void 0, void 0, function* () { - createArgs.push('--driver-opt', driverOpt); - })); - if (inputs.buildkitdFlags && semver.satisfies(buildxVersion, '>=0.3.0')) { - createArgs.push('--buildkitd-flags', inputs.buildkitdFlags); + if (semver.satisfies(buildxVersion, '>=0.3.0')) { + let hasImageDriverOpt = false; + yield context.asyncForEach(inputs.driverOpts, (driverOpt) => __awaiter(this, void 0, void 0, function* () { + if (driverOpt.startsWith('image=')) { + hasImageDriverOpt = true; + } + createArgs.push('--driver-opt', driverOpt); + })); + if (!hasImageDriverOpt) { + //FIXME: Temporary fix (docker/build-push-action#154, docker/build-push-action#162) + createArgs.push('--driver-opt', 'image=moby/buildkit:v0.8-beta'); + } + if (inputs.buildkitdFlags) { + createArgs.push('--buildkitd-flags', inputs.buildkitdFlags); + } } if (inputs.use) { createArgs.push('--use'); diff --git a/src/main.ts b/src/main.ts index c9cc0cc..109af68 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,11 +33,21 @@ async function run(): Promise { if (inputs.driver !== 'docker') { core.info('🔨 Creating a new builder instance...'); let createArgs: Array = ['buildx', 'create', '--name', builderName, '--driver', inputs.driver]; - await context.asyncForEach(inputs.driverOpts, async driverOpt => { - createArgs.push('--driver-opt', driverOpt); - }); - if (inputs.buildkitdFlags && semver.satisfies(buildxVersion, '>=0.3.0')) { - createArgs.push('--buildkitd-flags', inputs.buildkitdFlags); + if (semver.satisfies(buildxVersion, '>=0.3.0')) { + let hasImageDriverOpt: boolean = false; + await context.asyncForEach(inputs.driverOpts, async driverOpt => { + if (driverOpt.startsWith('image=')) { + hasImageDriverOpt = true; + } + createArgs.push('--driver-opt', driverOpt); + }); + if (!hasImageDriverOpt) { + //FIXME: Temporary fix (docker/build-push-action#154, docker/build-push-action#162) + createArgs.push('--driver-opt', 'image=moby/buildkit:v0.8-beta'); + } + if (inputs.buildkitdFlags) { + createArgs.push('--buildkitd-flags', inputs.buildkitdFlags); + } } if (inputs.use) { createArgs.push('--use');