Repository navigation
Description
Summary
After the oras-go v3 migration (#2002) lands, adopt the v3 containers config stack (config.LoadConfigs()), gated behind an experimental environment variable so the default behavior stays identical to oras-go v2:
export ORAS_EXPERIMENTAL_CONTAINERS_CONFIG=1When unset (the default), oras keeps the current behavior: Docker config.json credentials only, no registries.conf, no certs.d, no policy.json.
When set, oras loads the containers config files supported by oras-go v3:
- Podman/containers
auth.jsoncredentials certs.dTLS configuration (Custom CA store #2118)registries.conf(mirrors, registry aliases)policy.json(later phase; enforcement needs its own UX design)
Background
#2002 is a mechanical migration and deliberately preserves v2 behavior where v3 defaults differ (for example IgnoreDefaultNativeStore: true in internal/credential/store.go, and the distribution-spec token flow via auth.NewCompositeTokenFetcher). It does not call config.LoadConfigs(). This issue tracks that follow-up, which was previously proposed in #2268.
oras has no runtime feature-flag mechanism today; it only labels flags as [Experimental] / [Preview] in help text. The only existing env var is ORAS_CACHE.
Proposal
The switch only needs to be checked in two places:
internal/credential.NewStore: if the env var is set, build the credential store fromconfig.LoadConfigs()(includingauth.json); otherwise keep the existing Docker config store.option.Remoteclient/repository construction: if the env var is set, applycerts.dTLS andregistries.confmirror/alias resolution (and laterpolicy.json); otherwise unchanged.
Why an environment variable rather than a flag
- Process-wide:
login,logout, and every remote command go throughNewStore/option.Remote; one env check covers all of them. - No flag duplication: a flag on
option.Remotewould be prefixed into--from-…/--to-…onoras cp, which is meaningless for a global setting. - Easy to graduate: when stable, flip the default and keep the variable (e.g.
=0) as an opt-out without breaking scripts. - Precedent:
ORAS_CACHEalready configures oras via the environment.
An [Experimental] persistent root flag could be added later for discoverability if maintainers prefer.
Open questions
- Credential precedence: when both
~/.docker/config.jsonandauth.jsonhave an entry for the same registry, which wins? This is the main user-visible difference and should be decided and documented up front. - How does
--registry-configinteract with the gate (override the whole stack, or only the credential file)? - Should
oras loginwrite toauth.jsonor keep writing to the Docker config when the gate is on? - Exact variable name (
ORAS_EXPERIMENTAL_CONTAINERS_CONFIGis a placeholder).
Suggested implementation order
- Env var plumbing + credential store via
config.LoadConfigs()(read-onlyauth.jsonsupport) certs.dTLS (Custom CA store #2118)registries.confmirrors/aliasespolicy.json(separate design)
Each step with unit tests and E2E coverage both with and without the variable set.
Depends on #2002.
Activity
TerryHowe commentedon Nov 2, 2026
Done