RHEL rpm repository downloader and http web server. Useful for offline mirroring of RHEL RPM packages.
These scripts contains the downloader for rpm repositories and the http web-server for hosting the rpm repositories. The downloader will download the rpm repositories listed in repolist
for RHEL-7
or CentOS-7
. For other versions of RHEL
, do update the Dockerfile-downloader-rhel
according to your desired version. The 2nd service will then serve the rpm repository with nginx
.
- Tested on
Docker-Desktop
forWindows
- Online connection
- Ensure
download-repo.sh
andrepolist
are inLF
line ending formats - (Optional): Update
repolist
with your required rpm repos using it'sRepo ID
, separated by newlines. You may refer to here for instructions on retrieving theRepo ID
fromRed Hat
. If./repolist
is empty, it will download all repositories in/etc/yum.repos.d/*
- Redhat account with relevant subscriptions (RHEL subscription)
- Update
CHANGE_ME
fields with the required inputs (username/password for Redhat) - Change the
docker-compose
to point to./Dockerfile-downloader-rhel
instead.
- Make sure to fulfil the requisites
docker-compose build
docker run --rm rhel-rpm-downloader-and-server-rpm-download subscription-manager repos
to find the list of applicableRepo ID
s for the RHEL repos.
- or
docker run --rm rhel-rpm-downloader-and-server-rpm-download yum repolist -y
for non-Redhat repositories. The repoId is listed under therepo id
col, use the name only without the parts seperated by the/
.
- Run
docker-compose up --build
- View your downloaded files in
./rpm
- The file structure should be:
./rpm
./rpm/repodata
./rpm/<REPO_ID_1>
./rpm/<REPO_ID_2>
- The file structure should be:
- The 2nd docker service will serve the rpm repository with nginx at port
80
/http
For repos that are not available in Redhat's repositories. You will need to add them into the Docker image manually. This can be done by manually editing Dockerfile-downloader
.
...
# Any other non-standard yum repositories ...
## FOR NVIDIA CONTAINER TOOLKIT REPO ...
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo