Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions runpodctl/reference/runpodctl-registry.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in runpodctl/reference/runpodctl-registry.mdx

View check run for this annotation

Mintlify / Mintlify Validation (runpod-b18f5ded) - vale-spellcheck

runpodctl/reference/runpodctl-registry.mdx#L1

Try to keep the Flesch reading ease score (55.13) above 70.

Check warning on line 1 in runpodctl/reference/runpodctl-registry.mdx

View check run for this annotation

Mintlify / Mintlify Validation (runpod-b18f5ded) - vale-spellcheck

runpodctl/reference/runpodctl-registry.mdx#L1

Try to keep the Coleman–Liau Index grade (10.13) below 9.

Check warning on line 1 in runpodctl/reference/runpodctl-registry.mdx

View check run for this annotation

Mintlify / Mintlify Validation (runpod-b18f5ded) - vale-spellcheck

runpodctl/reference/runpodctl-registry.mdx#L1

Try to keep the LIX score (38.40) below 35.

Check warning on line 1 in runpodctl/reference/runpodctl-registry.mdx

View check run for this annotation

Mintlify / Mintlify Validation (runpod-b18f5ded) - vale-spellcheck

runpodctl/reference/runpodctl-registry.mdx#L1

Try to keep the Gunning-Fog index (10.12) below 10.
title: "registry"
sidebarTitle: "registry"
---
Expand Down Expand Up @@ -39,12 +39,46 @@

### Create a registry authentication

Create credentials for a private container registry:
Create credentials for a private container registry. Supply the password in one of three ways:

- Pass it directly with the `--password` flag.
- Pipe or redirect it into `--password-stdin`.
- Omit both flags to enter it at an interactive prompt.

Pass the password directly with `--password`:

```bash
runpodctl registry create --name "docker-hub" --username "myuser" --password "mypassword"
```

Omit the password flag to have the command prompt for the password without echoing it:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

promptPassword uses term.ReadPassword, which disables terminal echo, confirming the interactive prompt does not echo input; triggered only when stdinIsTerminal() (line 141).

Source: https://github.com/runpod/runpodctl/blob/0592468b1f1f02d8ca10485af56192ebf9a84d05/cmd/registry/create.go#L92-L100


```bash
runpodctl registry create --name "docker-hub" --username "myuser"
```

Pipe a token held in an environment variable into `--password-stdin`:

```bash
printenv REGISTRY_TOKEN | runpodctl registry create --name "docker-hub" --username "myuser" --password-stdin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cobra Example field for registry create shows the pipe (printenv | ... --password-stdin) and file-redirection (--password-stdin < token.txt) invocation forms matched by the docs examples.

Source: https://github.com/runpod/runpodctl/blob/0592468b1f1f02d8ca10485af56192ebf9a84d05/cmd/registry/create.go#L27-L34

```

Redirect a token from a file into `--password-stdin`:

```bash
runpodctl registry create --name "docker-hub" --username "myuser" --password-stdin < token.txt
```

For Google Artifact Registry or gcr.io, set `--username` to the literal `_json_key` and feed the multi-line service-account JSON key file through `--password-stdin`. The command supports multi-line passwords and strips only a single trailing newline added by the pipe or redirection.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TrimSuffix(TrimSuffix(data, "\n"), "\r") strips only a single trailing newline (\n or \r\n) added by a pipe/redirection, preserving multi-line content such as a gcr.io _json_key service-account JSON key.

Source: https://github.com/runpod/runpodctl/blob/0592468b1f1f02d8ca10485af56192ebf9a84d05/cmd/registry/create.go#L127-L134


```bash
runpodctl registry create --name "gcr" --username "_json_key" --password-stdin < service-account.json
```

<Tip>
Prefer `--password-stdin` or the interactive prompt over `--password`. A value passed to `--password` is visible in the process table and your shell history.
</Tip>

#### Create flags

<ResponseField name="--name" type="string" required>
Expand All @@ -55,8 +89,12 @@
Registry username.
</ResponseField>

<ResponseField name="--password" type="string" required>
Registry password or access token.
<ResponseField name="--password" type="string">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

init() marks only --name and --username required via MarkFlagRequired; --password-stdin is a BoolVar (no value); MarkFlagsMutuallyExclusive("password", "password-stdin") makes the two password flags mutually exclusive.

Source: https://github.com/runpod/runpodctl/blob/0592468b1f1f02d8ca10485af56192ebf9a84d05/cmd/registry/create.go#L47-L57

Registry password or access token. Cannot be used with `--password-stdin`. If neither `--password` nor `--password-stdin` is given, the command prompts for the password when run in an interactive terminal, or exits with an error otherwise.
</ResponseField>

<ResponseField name="--password-stdin" type="bool">
Read the registry password from standard input (pipe, heredoc, or file redirection). Supports multi-line values. Cannot be used with `--password`.
</ResponseField>

### Delete a registry authentication
Expand Down
Loading