-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial
I would like to thank all the great users of the Manjaro forum who improved my tutorial and made it more understandable 💛
Difficulty: ★★☆☆☆
This tutorial will help you set up a pacman mirror using a Synology Diskstation, which will allow you to minimize Internet traffic when deploying to multiple Manjaro Workstations / Servers on your LAN.
A small alpine image has been used with rsync
and nginx
included. The details can be found here on on GitHub
When starting the container, two simple things happen:
-
nginx
is started - An
rsync
script runs in an infinite loop with configurable sleep (default 6 hours)
The installation can be done on a server or on a NAS.
Prerequisites:
-
docker
installed on the server - (optional)
docker-compose
installed on the server - root rights or membership of the docker group
📜 Installation steps with commands
mkdir -p /docker-data/manjaro-mirror
docker run -d \
--name=manjaro-mirror \
-p 8080:80 \
-v /docker-data/manjaro-mirror:/srv/http/manjaro \
-e SOURCE_MIRROR=rsync://YOUR_COUNTRY_MIRROR \ # omit the line for default
--restart unless-stopped \
ghcr.io/twiese99/manjaro-package-mirror
Create a file named docker-compose.yaml
with the following content:
---
version: "3.4"
services:
manjaro-mirror:
container_name: manjaro-mirror
image: ghcr.io/twiese99/manjaro-package-mirror
environment:
- SOURCE_MIRROR=rsync://YOUR_COUNTRY_MIRROR \ # omit this and the line above for default
volumes:
- /docker-data/manjaro-mirror:/srv/http/manjaro
ports:
- 8080:80
restart: unless-stopped
Start the container with:
docker-compose up -d
Prerequisites:
- docker installed on your nas
- membership of the admin group
📜 Installation steps with pictures
The download of the image is done via the normal interface of the NAS. Simply search for "manjaro-package-mirror" and download the latest version.
From the menu we now go to "Image" and select the image. Then we click on "Start". A window should open.
In the window which has opened now, click Advanced settings.
There we select the Volume tab from the bar and click on Add Folder. Now select or create a folder where the packet data of the Manjaro mirror should be located later. As mount path we have to enter /srv/http/manjaro
.
Now go to Port Settings and enter the port you want, e.g. 8080, over which the mirror should be reachable via your NAS IP. Please make sure not to use any reserved or already used ports.
Last but not least, we come to the point "Environment". I recommend each of you to find out which mirrors in your country (if any) support rsync. By default the container uses the mirror rsync://mirrorservice.org/repo.manjaro.org/repos/
. Please change that to a mirror close to you.
If you have found a mirror, you can overwrite the value of the variable SOURCE_MIRROR
with its address (please make sure to specify rsync://
as well). Otherwise just leave it at the default settings.
When everything is done click on Apply (the blue button on the bottom right) and start the container.
No matter which variant you choose, you will have a full-fledged Manjaro / pacman mirror running. Please note that the first time you start / sync the container, it may take a while until it starts to create files in the directory. This also depends on which mirror you have chosen for synchronization.