Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Better error prompt when Docker Desktop is installed #26

@shizhMSFT

Description

@shizhMSFT

What is the version of your ORAS CLI

v0.16.0

What would you like to be added?

When Docker Desktop for Windows or macOS installed and is not currently running, running oras will encounter an error.

$ oras login $reg --username $name --password $secret
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error: error storing credentials - err: exit status 1, out: `Post "[http://ipc/registry/credstore-updated":](http://ipc/registry/credstore-updated%22:) open \\.\pipe\dockerBackendApiServer: The system cannot find the file specified.`

It is better to have something like

$ oras login $reg --username $name --password $secret
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error: error storing credentials: credential store is configured to `desktop` and docker desktop seems not running

It would be even better to give users an option to update the credential store. A sample output on Windows could be

$ oras login $reg --username $name --password $secret
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error: error storing credentials: credential store is configured to `desktop` and docker desktop seems not running
Do you want to update the global credential store to `wincred`? [y/N]

Why is this needed for ORAS?

oras in general does not require docker or dockerd. oras reuses the docker config file and docker desktop sets the credential store to docker desktop when docker desktop is installed.

Here are the scenarios for the complete behavior.

  • Scenario 1: Running oras on Linux without docker installed
    • oras works and will save the credentials to ~/.docker/config.json on oras login.
  • Scenario 2: Running oras on Linux with docker installed
    • oras works and reuses the docker credentials in ~/.docker/config.json. If credential store is configured, oras also re-uses the credential store.
  • Scenario 3: Running oras on Windows without docker desktop installed
    • Same as Scenario 1
  • Scenario 4: Running oras on Windows with docker desktop installed
    • oras works but reuses the docker credentials in ~/.docker/config.json. By default, it requires docker desktop running to run oras.
    • Mitigation step: Edit ~/.docker/config.json and replace desktop with wincred for the credStore field.
  • Scenario 5: Running oras on macOS without docker desktop installed
    • Same as Scenario 1
  • Scenario 6: Running oras on macOS with docker desktop installed
    • Same as Scenario 4 but replace desktop with osxkeychain.

It would be better to let the users know what's the next steps, such as run Docker Desktop or update the config, when they encounter the weird pipe error.

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.

Metadata

Metadata

Labels

Type

No type
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