mirror of
https://github.com/docker/build-push-action.git
synced 2025-06-22 10:28:00 +02:00
Add install input to set buildx as default builder (#71)
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@ -14,6 +14,7 @@ async function run(): Promise<void> {
|
||||
}
|
||||
|
||||
const buildxVer: string = core.getInput('buildx-version') || 'latest';
|
||||
const install: boolean = /true/i.test(core.getInput('install'));
|
||||
const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');
|
||||
await installer.buildx(buildxVer, dockerConfigHome);
|
||||
|
||||
@ -34,6 +35,11 @@ async function run(): Promise<void> {
|
||||
core.info('🏃 Booting builder...');
|
||||
await exec.exec('docker', ['buildx', 'inspect', '--bootstrap']);
|
||||
|
||||
if (install) {
|
||||
core.info('🤝 Setting buildx as default builder...');
|
||||
await exec.exec('docker', ['buildx', 'install']);
|
||||
}
|
||||
|
||||
core.info('🐳 Docker info');
|
||||
await exec.exec('docker', ['info']);
|
||||
|
||||
|
Reference in New Issue
Block a user