nsc registry policy makes it possible to query and modify the expiration policy applied to new images uploaded to nscr.io.
By default, images stored in nscr.io never expire. The expiration duration needs to be at least 4 hours.
Once an image expires it can no longer be accessed and the underlying blobs are automatically deleted.
Policies can be set at two levels:
- Default policy: applies to all repositories that don’t have a repository-specific policy.
- Repository policy: overrides the default policy for a specific repository.
Usage
Examples
Get the current default policy:Available Commands
- get - Gets the policy settings that are currently configured; if
--repositoryis specified, gets the policy for that repository. - set - Sets the policy settings; if
--repositoryis specified, sets the policy for that repository, otherwise sets the default policy.
Options
get
—repository <repository>
Get the policy for a specific repository. If not specified, returns the default policy.-o <format>
The output format. Can either betable or json.
set
—default_expiration <duration>
How long an image should exist after its creation. The duration is specified as a string (e.g.,168h for 7 days).
The provided value needs to be at least 4 hours.