Skip to content

refactor: centralize Docker volume guard in a shared helper #1

Description

@maovidal

Problem

The buildroot_workspace volume creation guard is duplicated across all run scripts in every BR2_EXTERNAL:

docker volume inspect buildroot_workspace >/dev/null 2>&1 || docker volume create buildroot_workspace

This pattern appears in 16+ files across 5 repos. If the volume name changes or the logic needs to evolve (e.g., checking Docker is running first), all files in all repos must be updated.

Proposed solution

Extract the guard into a shared helper in docker-buildroot/scripts/ that run scripts source. Since all run scripts already execute from the docker-buildroot root, this formalizes an implicit dependency that already exists.

Impact

  • scripts/run_template.sh — add sourcing of shared helper
  • All existing run scripts in each BR2_EXTERNAL — update to source helper instead of inline guard
  • No functional change for end users

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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