# Elastic mirror (pkg.shecan.ir)

> Pull-through mirror of docker.elastic.co (Elasticsearch, Kibana, Logstash, Beats, Elastic Agent, ECK).

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

## Limitations

- Pull only: no docker login is needed and push is disabled.
- Write mirror-docker-elastic.pkg.shecan.ir instead of docker.elastic.co in image names; the rest of the name is unchanged.
- 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-docker-elastic.pkg.shecan.ir/elasticsearch/elasticsearch:8.15.3
```

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

Configuration file (linux): `/etc/containerd/certs.d/docker.elastic.co/hosts.toml`

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

Undo / restore the default (linux)

```sh
sudo rm /etc/containerd/certs.d/docker.elastic.co/hosts.toml
```

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

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

```toml
[[registry]]
prefix = "docker.elastic.co"
location = "docker.elastic.co"

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

Undo / restore the default (linux)

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