Skip to content

Expose builder name as a name output for docker/setup-buildx-action compatibility #103

@mkusaka

Description

@mkusaka

Summary

useblacksmith/setup-docker-builder creates and selects a Buildx builder, but it does not expose the selected builder name as an action output.

This makes migration from docker/setup-buildx-action harder for workflows that pass steps.<id>.outputs.name to scripts or explicit --builder flags.

Motivation

docker/setup-buildx-action exposes a name output:

outputs:
  name:
    description: "Builder name"

and sets it in the action implementation. Existing workflows may rely on it:

- id: buildx
  uses: docker/setup-buildx-action@v4

- run: make docker.push
  env:
    DOCKER_BUILDX_INSTANCE: ${{ steps.buildx.outputs.name }}

When replacing docker/setup-buildx-action with useblacksmith/setup-docker-builder, steps.buildx.outputs.name is empty.

Current behavior

The action generates a builder name internally, creates a remote builder, and runs docker buildx use <name>, but later workflow steps cannot read the selected builder name.

Expected behavior

Expose the selected builder name as a name output, compatible with docker/setup-buildx-action migration patterns.

Example:

- id: buildx
  uses: useblacksmith/setup-docker-builder@v1

- run: docker buildx bake --builder "${BUILDX_NAME}"
  env:
    BUILDX_NAME: ${{ steps.buildx.outputs.name }}

Proposed implementation

When a Blacksmith builder is created, call:

core.setOutput("name", name);

For fallback or reused-builder paths, it would also be useful to expose the actual selected builder name if it can be determined from toolkit.builder.inspect().

Related

This is related to, but distinct from, #70.

#70 asks for setting BUILDX_BUILDER for subsequent steps, especially for plain docker build. This issue is specifically about exposing the builder name as an action output for compatibility with docker/setup-buildx-action migration patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions