Skip to content

Support buildkit backend for local builds #3293

Description

@hellt

Is your feature request related to a problem?

Yes. When localRegistry.enabled: true and localbuild: true, DevSpace routes image builds through its localregistry engine, which uses the Docker ImageBuild API (classic docker build) on the host. That path does not use BuildKit.

This breaks Dockerfiles that rely on BuildKit-only syntax (for example RUN --mount=type=secret, cache mounts, etc.). In our case, build/launcher.Dockerfile used an optional RUN --mount=type=secret for injecting a host CA bundle behind an MITM proxy; builds failed with: the --mount option requires BuildKit

Per-image buildKit: configuration in devspace.yaml is ignored while localRegistry is enabled, so we cannot switch to docker buildx build for those images without disabling the local registry workflow.

Which solution do you suggest?

Allow BuildKit for local builds when using localRegistry, for example:

  1. Honor buildKit per image even when localRegistry is enabled — if an image defines buildKit:, use docker buildx build (or equivalent) on the host and push to the local registry URL, instead of forcing the legacy ImageBuild API for all images.

  2. Or add an explicit opt-in, e.g. localRegistry.localbuildKit: true (or localRegistry.buildEngine: buildkit), that makes localbuild: true use BuildKit on the host while still pushing to the rewritten localhost:<port>/... registry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureNew feature or feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions