This project allows you to mirror apt, PyPI and Maven repositories in your local server programmatically. Preconfigured container downloads software packages via Nexus. You may configure which packages or how many packages will be downloaded or you may automate the process with a CI tool.
You need Docker to run the project. The following instructions are tested on Debian.
Create proxy repos on Nexus according to the following configuration. You may install Nexus as a Docker container, just follow the instructions.
Then, change the IP addresses in each file in configFiles directory with your URLs.
- After cloning the project, change directory to the folder in which
Dockerfileexists. - Build a docker image:
docker build -t your-image-name . - If it is succesfully built, you can view it in the images list by typing:
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
your-image-name latest d017f02c1ec8 13 seconds ago 1.17GB
If it fails, be sure that you changed the IP address in /configFiles/sources.list with your own URL.
- After building the image, you can create a container and connect it:
docker run -it --rm your-image-name /bin/bash - Change directory to
installScripts:cd installScripts - To download Debian packages, run the following command:
python debianDownloadMetadata.py && \
chmod +x debianInstallPackages.sh && \
./debianInstallPackages.sh
-
debianDownloadMetadata.pyscript downloads the names of all Debian packages and writes them todebianAllPackagesList.txt.debianInstallPackages.shscript reads the text file and downloads packages. By default, first 10 packages are downloaded but you can change the script to download all packages (just replaceforloop withwhileloop). -
To download PyPI packages, run the following command:
python pipDownloadMetadata.py && \
chmod +x pipInstallPackages.sh && \
./pipInstallPackages.sh
-
pipDownloadMetadata.pyscript downloads the names of all PyPI packages and writes them topipAllPackagesList.txt.pipInstallPackages.shscript reads the text file and downloads packages. By default, first 10 packages are downloaded but you can change the script to download all packages (just replaceforloop withwhileloop). -
To download Maven packages, run the following command:
python mavenDownloadMetadata.py && \
chmod +x mavenInstallPackages.sh && \
./mavenInstallPackages.sh
mavenDownloadMetadata.pyscript downloads the names of Maven packages in the format ofgroupId:artifactId:versionand writes them tomavenAllPackagesList.txt. By default, artifacts inantgroup are downloaded but you can change the group (or use all repo but it is too slow) in the script.
You may add new repositories or improve the existing ones.
