# Google Artifact Registry mirror (pkg.shecan.ir)

> Pull-through mirror of us-docker.pkg.dev (Google Artifact Registry, US multi-region: e.g. Google samples, Cloud Run, Vertex AI and Deep Learning Containers).

- Upstream: us-docker.pkg.dev
- Mirror URL: <https://mirror-pkgdev.pkg.shecan.ir/>
- Clients: docker, podman, containerd, skopeo
- Service status: <https://pkg.shecan.ir/status.json> (key `pkgdev`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/pkgdev/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/pkgdev.json>

## Limitations

- Pull only: no docker login is needed and push is disabled.
- Write mirror-pkgdev.pkg.shecan.ir instead of us-docker.pkg.dev in image names; the rest of the name is unchanged.
- Public images only, and only the us-docker.pkg.dev multi-region: europe-docker.pkg.dev, asia-docker.pkg.dev and regional <region>-docker.pkg.dev hosts are not mirrored (Google publishes most public images to us-docker.pkg.dev too).
- containerd reads hosts.toml only when its registry config_path is /etc/containerd/certs.d.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### docker, podman: temporary (one command or the current shell; nothing saved)

Run

```sh
docker pull mirror-pkgdev.pkg.shecan.ir/google-samples/containers/gke/hello-app:1.0
```

### containerd: persistent (user- or system-wide configuration)

Configuration file (linux): `/etc/containerd/certs.d/us-docker.pkg.dev/hosts.toml`

```toml
server = "https://us-docker.pkg.dev"
[host."https://mirror-pkgdev.pkg.shecan.ir"]
  capabilities = ["pull", "resolve"]
```

Undo / restore the default (linux)

```sh
sudo rm /etc/containerd/certs.d/us-docker.pkg.dev/hosts.toml
```

### podman, skopeo: persistent (user- or system-wide configuration)

Configuration file (linux): `/etc/containers/registries.conf`

```toml
[[registry]]
prefix = "us-docker.pkg.dev"
location = "us-docker.pkg.dev"

[[registry.mirror]]
location = "mirror-pkgdev.pkg.shecan.ir"
```

Undo / restore the default (linux)

```sh
sudo sed -i '/^\[\[registry\]\]$/{N;/\nprefix = "us-docker.pkg.dev"$/{N;N;N;N;d}}' /etc/containers/registries.conf
```
