# View a repository's packages

See the container images and npm packages a repository publishes, with their latest version and scan.

**Packages** in a repository lists the container images and npm packages it publishes, with the
latest version, the pull or install command and, for images, the vulnerability scan. The
registries' own pages stay the view across all repositories.

## Prerequisites

- Permission for `git:GetRepository` on the repository.
- `ecr:DescribeRepositories` to see container images, and `npm:ListPackages` to see npm packages.
  Without one of them, the page lists only the other kind and says which permission is missing.

## View them

**Console**
1. Open the repository, then choose **Packages**. The repository's packages are listed with their
   latest version, the `docker pull` or `npm install` command and, for images, the scan result.
   With none, the page shows **No packages from this repository**.

## How a package is linked to a repository

| Link                   | Container image                                                                                                                                        | npm package                                                                                                   |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| Built by an app        | the image repository an app created, when the app deploys from this repository                                                                         | none                                                                                                          |
| Names it as its source | the manifest annotation `org.opencontainers.image.source` is the repository's clone URL, with or without `.git` (`docker buildx build --annotation …`) | `repository` in a published version's `package.json` holds the repository's clone URL, with or without `.git` |
| Same name              | the image repository is called like the git repository, or ends in `/` and its name (`orders` or `team/orders`)                                        | the package is called like it, or ends in `/` and its name (`orders` or `@acme/orders`)                       |

To link an image by its source, annotate it when you build it:

```sh
docker buildx build \
  --annotation "manifest:org.opencontainers.image.source=https://git.<platform domain>/my-org/my-repo" \
  -t my-org.ecr.<platform domain>/api:1.4.0 --push .
```

## Related

- [Container registry](/docs/ecr)
- [npm Registry](/docs/npm-registry)
