Status : tested & working ✔️
-
Setup your CentOS version and releases in
mirror.sh
-
Run the
mirror
container :docker-compose build docker-compose up mirror
Tips: We recommend you downloading the mirror from a cloud provider and then transfer the files to your computer.
-
Check your mirroring succeeded in
./mirror/*
or typingdu -sh ./mirror
to check the volumeThe default configuration should make you download 22G
-
Run the server :
docker-compose up -d server
Server will run on
localhost:8080
To point your CentOS clients to your mirror, create a /etc/yum.repos.d/localmirror.repo
file as follow :
[mymirror-base]
name=My CentOS 7 local mirror for os packages
baseurl=http://localhost:8080/7/os/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[mymirror-extras]
name=My CentOS 7 local mirror for extras packages
baseurl=http://localhost:8080/7/extras/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[mymirror-updates]
name=My CentOS 7 local mirror for updates packages
baseurl=http://localhost:8080/7/updates/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[mymirror-centosplus]
name=My CentOS 7 local mirror for centosplus packages
baseurl=http://localhost:8080/7/centosplus/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
👉 Feel free to add a reverse proxy or update the nginx configuration file to secure the mirror with SSL/TLS
👉 Feel free to send pull requests as well !