> ## 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 base-image optimize

Optimize a base image so Namespace can boot instances from it quickly.

`base-image optimize` converts an image that already lives in `nscr.io` into an optimized variant. You only need to optimize a given image digest once. The command blocks until the optimized variant is ready.

## Usage

```bash theme={null}
nsc base-image optimize --image_ref <repo>@sha256:<digest>
```

### Example

```bash theme={null}
nsc base-image optimize \
  --image_ref nscr.io/8enum0hp1l5ii/my-worker@sha256:6726e6afa50ad90112c7bd1082eb879cc5d1c87574d70e177813d0ca75617e56
```

## Required Flags

<h3 id="--image_ref-string">
  \--image\_ref string
</h3>

The image reference to optimize. Pin it to an immutable digest
(`<repo>@sha256:<digest>`).

## Optional Flags

<h3 id="--site-string">
  \--site string
</h3>

Which site to optimize on. Leave blank for Namespace to decide.

## Related Topics

* [nsc base-image upload](/docs/reference/cli/base-image-upload) - Convert an existing image into a base image and upload it to nscr.io
* [nsc build](/docs/reference/cli/build) - Build container images using Namespace Remote Builders
* [Bazel Remote Execution](/docs/bazel/execution) - Use custom worker images with RBE
