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

> Pull-through mirror of gcr.io (Google Container Registry: distroless, Kaniko and other public Google images).

- Upstream: gcr.io
- Mirror URL: <https://mirror-gcr.pkg.shecan.ir/>
- Clients: docker, podman, containerd, skopeo
- Service status: <https://pkg.shecan.ir/status.json> (key `gcr`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/gcr/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/gcr.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `docker-gcr-io`, mirror `shecan`): <https://audit.shecan.ir/#docker-gcr-io>

## Limitations

- Pull only: no docker login is needed and push is disabled.
- Write mirror-gcr.pkg.shecan.ir instead of gcr.io in image names; the rest of the name is unchanged.
- Public images only. The regional hosts us.gcr.io, eu.gcr.io and asia.gcr.io are not mirrored.
- 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-gcr.pkg.shecan.ir/distroless/static:nonroot
```

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

Configuration file (linux): `/etc/containerd/certs.d/gcr.io/hosts.toml`

```toml
server = "https://gcr.io"
[host."https://mirror-gcr.pkg.shecan.ir"]
  capabilities = ["pull", "resolve"]
```

Undo / restore the default (linux)

```sh
sudo rm /etc/containerd/certs.d/gcr.io/hosts.toml
```

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

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

```toml
[[registry]]
prefix = "gcr.io"
location = "gcr.io"

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

Undo / restore the default (linux)

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