https://github.com/futuretea/docker-local-mirror
https://github.com/futuretea/docker-local-mirror
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/futuretea/docker-local-mirror
- Owner: futuretea
- Created: 2023-04-24T05:38:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-30T06:20:14.000Z (about 3 years ago)
- Last Synced: 2025-01-22T01:36:33.322Z (over 1 year ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-local-mirror
## Requirements
- `regctl` from https://github.com/regclient/regclient/releases
- `fd` from https://github.com/sharkdp/fd/releases
## How to use
### Server
1. Prepare a directory for storing the mirror data
```bash
sudo mkdir -p /data/dockerhub
sudo chown -R ${USER} /data/dockerhub
```
2. Run the docker-compose
```bash
cd dockerhub
docker-compose up -d
```
### Client
```bash
vim /etc/docker/daemon.json
```
```json
{
"registry-mirrors":[
"http://:5000"
],
"insecure-registries":[
"http://:5100"
],
"max-concurrent-downloads": 10,
"log-driver": "json-file",
"log-level": "warn",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"features": {
"buildkit": true
}
}
```
### Clean head images daily
```bash
crontab -e
```
Add the following cron job
```cron
0 0 * * * /your-path-to-this-repo/docker-local-mirror/dockerhub/clean.sh head
```