> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# nsc docker login

Log into the Namespace Container Registry for use with Docker.

`docker login` automatically updates your default Docker `config.json` file with the
Namespace [credential helper](https://docs.docker.com/engine/reference/commandline/login/#credential-helpers)
and prints your Workspace registry endpoint.

The `docker-credential-nsc` credential helper is an executable binary that gets automatically installed alongside `nsc`.
Docker-like tools call the helper binary to retrieve fresh credentials every time they access the specified registry.

Docker-like tools expect the credential helper to be available in your `$PATH`.
You can check that the credential helper is in your path by running `which docker-credential-nsc`.

## Usage

```bash theme={null}
nsc docker login [--output_registry_to <file>] [--use_credential_helper]
```

### Example

<Steps titleSize="h4">
  <Step title="Log in to the registry">
    Log in to your workspace container registry:

    ```bash theme={null}
    nsc docker login
    ```

    ```text nocopy Output theme={null}
    You are now logged into your workspace container registry:
      nscr.io/8enum0hp1l5ii
    ```

    Where **8enum0hp1l5ii** is your **workspace ID**.
  </Step>

  <Step title="Push a container image">
    Use the `docker` CLI to push a container image to Namespace Container Registry:

    ```bash theme={null}
    docker push nscr.io/8enum0hp1l5ii/IMAGE_NAME
    ```
  </Step>
</Steps>

## Options

<h3 id="--output_registry_to-file">
  \--output\_registry\_to \<file>
</h3>

With this option `nsc` will write the Namespace Container Registry endpoint to
the provided file.

<h3 id="--use_credential_helper">
  \--use\_credential\_helper
</h3>

Use nsc's credential helper (`docker-credential-nsc`) instead of embedding the
Namespace Container Registry credentials directly in your Docker `config.json`.
Enabled by default (`--use_credential_helper=true`). Pass
`--use_credential_helper=false` to embed the credentials directly instead.
