Skip to content

CICD-135 · Log in without passwords on argv ​

Encyclopedia · Registries and releases · All snippets

Previous · CICD-134 · Next · CICD-136

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites authorized test registry, scoped credentials and candidate artifact.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters REGISTRY, REGISTRY_TOKEN, REGISTRY_USER.

2. Copy the snippet ​

bash
printf '%s' "${REGISTRY_TOKEN:?}" | docker login "${REGISTRY:?}" --username "${REGISTRY_USER:?}" --password-stdin

3. How it works ​

The registry client exchanges the scoped credential and stores authorization in the configured Docker client context.

4. Verify the result ​

Use a scoped secret on a trusted runner. Use an isolated Docker config and clean it up.

Watch for. Use the intended trusted execution context. Keep secret values out of traces, artifacts and debug output.

Validation syntax-validated (Bash parse). Status definitions.