stacklok / stacklok/toolhive

Support volume:// Named Volumes in CLI Mode

Open
#3,121 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

cli enhancement registry
Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Title

volume:// resource URI mounts are logged but not applied in CLI mode

Description

When using volume://name:container-path syntax in the CLI (either via -v flag or from registry permissions.write), ToolHive logs that it's adding the mount but then shows a warning and does not actually create the mount.

Steps to Reproduce

  1. Create a local registry file:
{
  "servers": {
    "test-server": {
      "image": "alpine:latest",
      "permissions": {
        "write": ["volume://my-test-volume:/app/data"]
      }
    }
  }
}
  1. Set the registry and run:
thv config set-registry ~/registry.json
thv run test-server
  1. Check container mounts:
docker inspect test-server | jq ".[0].Mounts"
# Returns: []
  1. Check logs:
cat ~/Library/Application\ Support/toolhive/logs/test-server.log | grep -i volume
# Shows: Warning: Resource URI mounts not yet supported: volume://my-test-volume

Expected Behavior

Docker named volumes should be created and mounted, similar to:

docker run -v my-test-volume:/app/data alpine

This would allow:

  • Zero-setup data persistence (Docker manages the volume)
  • No mkdir -p prerequisites for users
  • Seamless registry-based installation without manual volume flags

Actual Behavior

  • ToolHive logs Adding volume mount: volume://my-test-volume -> /app/data (read-write)
  • Then logs Warning: Resource URI mounts not yet supported: volume://my-test-volume
  • Container starts with no mounts

Environment

  • ToolHive version: v0.6.14 (also tested v0.6.15)
  • Platform: macOS (darwin/arm64)
  • Container runtime: Docker Desktop

Related

  • The volume:// syntax appears to be documented and parsed, but implementation is incomplete for CLI mode
  • Path-based bind mounts (/host/path:/container/path) work correctly from registry permissions.write
  • This may already work in Kubernetes mode (as PVC references) but not CLI/Docker mode

Suggested Implementation

When ToolHive sees volume://name:container-path:

  1. Create a Docker named volume if it doesn't exist
  2. Mount it at the specified container path
  3. Handle both permissions.read (read-only) and permissions.write (read-write)

This would match Docker's native behavior:

docker run -v my-volume:/app/data  # Creates volume if needed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI handling for the -v flag and registry permissions.write entries, then trace where the volume:// warning is emitted. Verify the Docker container configuration and named-volume behavior for both read-only and read-write mounts; done means the volume is created or reused and appears at the requested container path.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.