{"id":18736556,"url":"https://github.com/crazyvito11/docker-aur-cache","last_synced_at":"2026-02-22T22:48:57.887Z","repository":{"id":259998671,"uuid":"830670598","full_name":"CrazyVito11/docker-aur-cache","owner":"CrazyVito11","description":"Docker image that automatically builds AUR packages and hosts them for faster installation","archived":false,"fork":false,"pushed_at":"2025-01-25T16:05:18.000Z","size":199,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T10:37:47.928Z","etag":null,"topics":["archlinux","aur","aur-helper","aur-packages","build-server","cache","cache-server","docker","docker-compose","linux","nginx","nodejs","package-manager","package-mirror","pacman","pacman-package","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrazyVito11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-18T18:26:02.000Z","updated_at":"2025-01-17T20:42:14.000Z","dependencies_parsed_at":"2024-10-29T01:34:24.505Z","dependency_job_id":"75fba7a3-e1bd-463d-bc36-f34e8e4dafa0","html_url":"https://github.com/CrazyVito11/docker-aur-cache","commit_stats":null,"previous_names":["crazyvito11/docker-aur-cache"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyVito11%2Fdocker-aur-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyVito11%2Fdocker-aur-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyVito11%2Fdocker-aur-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrazyVito11%2Fdocker-aur-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrazyVito11","download_url":"https://codeload.github.com/CrazyVito11/docker-aur-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248211168,"owners_count":21065686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archlinux","aur","aur-helper","aur-packages","build-server","cache","cache-server","docker","docker-compose","linux","nginx","nodejs","package-manager","package-mirror","pacman","pacman-package","typescript"],"created_at":"2024-11-07T15:21:27.118Z","updated_at":"2026-02-22T22:48:52.861Z","avatar_url":"https://github.com/CrazyVito11.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker AUR Cache\nDocker image that automatically builds AUR packages and hosts them for faster installation on client devices.\n\n\n## Why?\n\u003e \"Why not just use an AUR helper to build the packages for you?\"\n\u003e\n\u003e _- Probably you_\n\nWhile AUR helpers can make it easier to manage your AUR packages, it does mean that you have another package manager that you have to run every once in a while to update your AUR packages. Which could result in you having to run 2 commands to update your system.\n\nSome AUR packages can also be quite complex, taking a while to compile, which you have to sit through every time you want to update your system.\n\nThis Docker container was made to compile these AUR packages beforehand, and then provide them in such a way so that pacman can install those AUR packages directly, without needing AUR helpers or other build tools on your machine.\nThis can also be extra beneficial if you have multiple computers running Arch Linux, as then you only have to compile the packages once for all those machines.\n\n\n## Setup (Container)\n1. Make sure you meet the follow prerequisites\n    - Docker + Docker Compose have been installed\n    - The [Traefik reverse proxy container](https://github.com/CrazyVito11/traefik-reverse-proxy) has been configured\n    - A registered domain name\n        - You can use something like [PiHole](https://github.com/pi-hole/pi-hole) to register local domains if you aren't going to host it publicly\n\u003e [!TIP]\n\u003e While this container was designed to work with Traefik and a domain name, with a couple of tweaks you can bind to a TCP port instead.\n\u003e Allowing you to skip the requirement of needing both Traefik and a domain name to host this application.\n\u003e\n\u003e See the section **Bind NGINX to port instead of Traefik** for instructions.\n2. Clone this repository to your server\n3. Make a copy of `.env.example` and call it `.env`\n4. Make changes to the `.env` file if needed\n5. Make a copy of `packagelist.json.example` and call it `packagelist.json`\n6. Add the packages you want to provide to the `packagelist.json` file\n    - You can find documentation about this file at section **Configure packagelist**.\n7. Update the repository permissions with `chmod 777 ./repository`\n    - **Note:** We are aware that this isn't very secure, this will be improved in the future.\n8. Build the container with `docker compose build`\n9. Start the container with `docker compose up -d`\n10. Set the right permissions with `docker compose exec build-manager bash -c 'chown builder /package-staging; chown builder /aur-package-list'`\n\nThe container should now be ready, try visiting your domain and you should see a index page!\nThis page will also show packages that are available for downloading.\n\n\u003e [!TIP]\n\u003e Normally you would have to wait until Monday @ 01:00 for it to start building, but instructions are available in case you want to start the build immediately.\n\u003e See the section **Force the build immediately** for more information.\n\n\n## Setup (Client)\nTo configure Pacman to use your self-hosted repository, open your `/etc/pacman.conf` file and add the following repository:\n\n```\n[docker-aur-cache]\nSigLevel = Optional\nServer = http://docker-aur-cache.localhost/\n```\n\n\u003e [!NOTE]\n\u003e Don't forget to update the URL to your configured URL.\n\nAnd that should be it!\nSimply perform a full system update and you should be able to install packages that are hosted by your instance.\n\n\n## Configure packagelist\nThe `packagelist.config.json` file is a JSON formatted file that will be used to configure all sorts of things, like which packages you want to build, the tweaks these packages need, limit system resources given to the builder, etc.\n\n### Packagelist config description\nThis is the root of the `packagelist.config.json` file.\n\n| **Field**      | **Required** | **Type**                   | **Description**                                                                   |\n|----------------|--------------|----------------------------|-----------------------------------------------------------------------------------|\n| `builderLimit` | Yes          | `builder limit object`     | Defines how many system resources the builder instance is allowed to use.         |\n| `packages`     | Yes          | `array of package objects` | An array of packages that you want to be build each time the builder is executed. |\n\n\n### Builder limit object description\nThis object is used to limit how many system resources the builder instance is allowed to use.\n\n| **Field**      | **Required** | **Type** | **Description**                                                                                                                                                                    |\n|----------------|--------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxBuildTime` | Yes          | `string` | Defines how long the build process is allowed to run for 1 package before it's terminated. The format is `1234X`, where X determines the scale. Allowed scales are `s`, `m`, `h` . |\n| `cpusetCpus`   | Yes          | `string` | Defines which CPU cores it's allowed to use. It can be a list _(`0,1,2,3`)_ of cores or a range of cores _(`0-3`)_.                                                                |\n| `memory`       | Yes          | `string` | Defines how much memory it's allowed to use before it's terminated. The format is `1234X`, where X determines the scale. Allowed scales are `b`, `k`, `m`, `g`.                    |\n\n\n### Package object description\nThis object is used to define the settings in order to build one specific package.\n\n| **Field**                | **Required** | **Type**               | **Description**                                                                                                            |\n|--------------------------|--------------|------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| `packageName`            | Yes          | `string`               | Defines the name of the AUR package that should be build.                                                                  |\n| `resolveDependenciesAs`  | No           | `object`               | A key-value mapping where the key is the original dependency, and the value is the replacement package that should be used.|\n| `runCommandsBeforeBuild` | No           | `array of strings`     | An array of shell commands to be executed before the package build process starts.                                         |\n\n\u003e [!TIP]\n\u003e The build process is executed in a separate container for each AUR package, which is destroyed after the build is complete.\n\u003e If you for example run a command for `package-a` to import a key that `package-b` will also need, you will have to add that command also to the configuration of `package-b`.\n\n\n## Tips\n### Force the build immediately\nIf you want the container to start building right now, you can run the following command:\n\n`docker compose exec --user builder build-manager bash /repository-builder/build-packages.sh`\n\nIt should now start building your packages, wait for this process to finish and then you can install the packages you configured.\n\n\n### Download older version of AUR package\nIf you need to downgrade a specific package for some reason, you can find older version in the `archive` directory of the webserver that is hosting the packages.\n\nSimply download the package from there and then install it manually with `pacman -U some-package-1.0.0-x86_64.pkg.tar.zst`.\n\n\u003e [!WARNING]\n\u003e Older versions of packages are automatically cleaned up after 30 days to preserve storage space on your server.\n\n\n### Package build fails with a SIGKILL\nChances are that the build process consumed too much memory and was killed by the Docker engine or the host operating system.\nThe builder process has been given a high OOM score to make sure it is killed first, instead of other _(potentially more crucial)_ applications.\n\nTo resolve this, you will have to raise the builder memory limit, free up more RAM on the host machine or upgrade the host machine to have more RAM.\n\n\u003e [!TIP]\n\u003e Sometimes the AUR also provides `-bin` _(precompiled binary)_ variants of a package, this could also be a solution to work around the issue.\n\n\n### Access the build reports\nThe application generates a report every time it runs the build process, allowing you to more easily troubleshoot troublesome packages.\n\nThese reports can be found in the `build-reports` directory of the webserver that is hosting the packages.\n\n\u003e [!TIP]\n\u003e For now these are only available in JSON format, but these will become easier to read in a future commit.\n\n\n### Bind NGINX to port instead of Traefik\nWhile it's intended to be used with my Traefik container, it does increase the steps needed to get this application up and running, and it might not even be possible in certain situations.\n\nWith a couple of modifications to the `docker-compose.yml` file you can skip the need for Traefik and a domain name, and just connect directly to a TCP port instead.\n\n1. Remove the entire `networks` section at the bottom, as we no longer need that external network.\n2. Remove the `labels` section from the `nginx` container.\n3. Remove the `traefik-reverse-proxy` network from the `nginx` container.\n4. Add a `ports` section to the `nginx` container and bind the port you want to use to `80` on the container.\n    - **Example:** `- 8080:80` to bind it to port `8080` on your host machine.\n\nIt should now be accessible on your desired TCP port without having to set up my Traefik configuration as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyvito11%2Fdocker-aur-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazyvito11%2Fdocker-aur-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyvito11%2Fdocker-aur-cache/lists"}