# Alpine Linux mirror (pkg.shecan.ir)

> Mirror of the official Alpine Linux repositories (dl-cdn.alpinelinux.org/alpine: main, community, edge testing; every release branch and architecture) for apk.

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

## Limitations

- apk still verifies the signed APKINDEX and every package checksum.
- Release images (ISO, minirootfs under releases/) are not served.
- Commands in /etc/apk/repositories run as root (in containers the default user).

## 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.

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

Back up first (linux)

```sh
cp /etc/apk/repositories /etc/apk/repositories.bak
```

Run (linux)

```sh
sed -i -E 's#https?://(dl-cdn\.alpinelinux\.org/alpine|cdn\.alpinelinux\.org(/alpine)?)/#https://mirror-alpine.pkg.shecan.ir/alpine/#' /etc/apk/repositories
apk update
```

Undo / restore the default (linux)

```sh
mv /etc/apk/repositories.bak /etc/apk/repositories
```

Configuration file, Alpine 3.24 full file (alternative; write the branch you run instead of v3.24) (linux): `/etc/apk/repositories`

```
https://mirror-alpine.pkg.shecan.ir/alpine/v3.24/main
https://mirror-alpine.pkg.shecan.ir/alpine/v3.24/community
```

### apk: project (files inside the project)

Configuration file, Dockerfile based on Alpine 3.24: `Dockerfile`

```dockerfile
FROM mirror-docker.pkg.shecan.ir/alpine:3.24
RUN sed -i -E 's#https?://(dl-cdn\.alpinelinux\.org/alpine|cdn\.alpinelinux\.org(/alpine)?)/#https://mirror-alpine.pkg.shecan.ir/alpine/#' /etc/apk/repositories \
    && apk add --no-cache curl
```
