Skip to content

Allow overriding daemon docker registry via env#591

Open
rksharma-owg wants to merge 1 commit into
agentregistry-dev:mainfrom
rksharma-owg:fix/553-arctl-daemon-registry-override
Open

Allow overriding daemon docker registry via env#591
rksharma-owg wants to merge 1 commit into
agentregistry-dev:mainfrom
rksharma-owg:fix/553-arctl-daemon-registry-override

Conversation

@rksharma-owg

Copy link
Copy Markdown

Problem

arctl daemon start always initializes the compose manager with the default docker registry (localhost:5001) via dockercompose.DefaultConfig() so CI and non-local environments cannot point daemon image pulls to another registry without code changes.

Root cause

In the root command wiring, the daemon manager was created with a fixed default config, and there was no environment-configurable override for DockerRegistry in this start path.

Focused solution

Add a small helper in pkg/cli/root.go that reads ARCTL_DAEMON_DOCKER_REGISTRY from environment (trimmed) and applies it to the daemon compose config before constructing clidaemon.NewCommand.

The default behavior remains unchanged (localhost:5001) when the variable is unset.

Files changed

  • pkg/cli/root.go
  • pkg/cli/root_test.go

Tests added

  • TestDaemonManagerConfigUsesEnvOverride (verifies whitespace-trimmed env override is applied)
  • TestDaemonManagerConfigFallsBackToDefaultRegistry (verifies default remains version.DockerRegistry when unset)

Validation

  • go test ./pkg/cli/...
  • make build-cli
  • ./bin/arctl daemon start

./bin/arctl daemon start and ARCTL_DAEMON_DOCKER_REGISTRY=registry.example.com ./bin/arctl daemon start are blocked in this environment because Docker daemon is not running, so both fail with:
Cannot connect to the Docker daemon at ... before registry resolution is reached.

Issue

Fixes #553

Known limitations

  • This change adds environment support but does not add a dedicated CLI flag for override; only ARCTL_DAEMON_DOCKER_REGISTRY is supported in this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arctl daemon start hardcodes localhost:5001 and lacks registry override

1 participant