# Share templates through a registry

Push a template to an OCI registry, then pull it on another Mac.

## Before you start

- [Make the template](https://osmates.com/docs/templates#make-a-template) you want to share.
- Sign in to the registry with `docker login`, which OSMates also uses. Without Docker, add `--username` to `push` or `pull`, and type the password when asked.
- Use HTTPS, unless the registry runs on your Mac.

## Push a template

Requires [OSMates Pro](https://osmates.com/docs/editions#what-pro-adds).

To push the template `base`:

```sh
osmates template push base ghcr.io/acme/base:1.0
```

The command prints the image's digest when it's done. If the push stops, run the same command again, and it sends only what's missing. To name your team beside the image, add `--publisher "Platform team"`.

The image holds the guest's disks as they are, with their accounts, keys, and files. The template's password, shared folders, credentials, and snapshots stay on your Mac.

## Pull a template

To pull it on another Mac and make a machine from it:

```sh
osmates template pull ghcr.io/acme/base:1.0
osmates vm clone base web
```

The template takes the last part of the image's name, here `base`. To choose another name, add it after the image. If the pull stops, run the same command again.

A tag can later point to a newer push. To get exactly one push, pull it by its digest:

```sh
osmates template pull ghcr.io/acme/base@sha256:<digest> base-1
```

The pulled template has no password. If you use `osmates vm sign-in`, set one with `osmates vm password base`.

## Make a machine from your team's image

Requires [OSMates Team](https://osmates.com/docs/editions#what-team-adds).

Your organization lists its images for you, or you name the repositories your team uses.

1. Choose **File > New Machine**.
2. Under **Organization Images**, choose an image and click **Continue**.
3. Enter a name and click **Create**.

The image is downloaded and checked against its digest before the machine appears. In Terminal, list the images with their tags, digests, and publishers:

```sh
osmates template repositories ghcr.io/acme/templates
osmates template list --remote
```

## Limits

- A template's data fits in about 500 GiB.
- Agents can't push or pull templates.
- A listing shows the newest 30 tags of each repository.
