TACC-Cloud / abaco-cli

Command line toolkit for developing, managing, and using Abaco Actors
Other
2 stars 3 forks source link

Detect or read container registry username at project initialization #23

Open mwvaughn opened 5 years ago

mwvaughn commented 5 years ago

The original behavior for abaco init was to write a stub username your_registry_username in the DOCKER_HUB_ORG config variable. This was because the Docker client is not able to reliably discern a user's currently configured username.

It was sometimes possible when clients used the legacy ~/.docker/config.json form that included a hashed version of user credentials, but the Docker CLI has moved (rightly) to using platform-level credential managers like the OSX Keychain. It is possible to query any of these managers, as they all follow an approximate specification, but an implementation for each manager is required.

As a stopgap, allow username (or org) to be provided when abaco init runs:

  1. The environment variable $DOCKER_HUB_ORG sets a global default value
  2. If it is not provided, default to current value of $USER
  3. If a value for -O is provided, override the established default
  4. Write final value in the DOCKER_HUB_ORG setting of project reactor.rc
mwvaughn commented 5 years ago

Implemented in d32e1127d1142e85b89cb2ce6de05b1a30105a2e

mwvaughn commented 5 years ago

Reopening to test