deb repo parser added, readme updated

This commit is contained in:
2022-11-22 18:35:59 +03:00
parent 8b465d8e25
commit c178256fc0
11 changed files with 98 additions and 41 deletions

View File

@@ -1 +1 @@
mirror_data/*
data/*

2
.gitignore vendored
View File

@@ -1 +1 @@
mirror_data/*
data/*

View File

@@ -1,15 +0,0 @@
FROM fedora:38
RUN yum -y install createrepo yum-utils
RUN mkdir /data/
VOLUME ["/data/"]
COPY entrypoint.sh /opt/entrypoint.sh
RUN mkdir /etc/yum.repos.d/mirror/
COPY repo_files/* /etc/yum.repos.d/mirror/
RUN mkdir /tmp/gpg_keys/
COPY gpg_keys/* /tmp/gpg_keys/
ENTRYPOINT ["/opt/entrypoint.sh"]

21
Dockerfile.deb Normal file
View File

@@ -0,0 +1,21 @@
FROM debian:10.5-slim
COPY config/deb/entrypoint.sh /opt/entrypoint.sh
RUN apt-get update -q \
&& \
apt install -y -qq apt-mirror \
&& \
apt-get autoremove \
&& \
rm -rf /var/cache/apt/* \
&& \
mkdir -p /data/ \
&& \
touch /var/log/cron.log \
&& \
chmod u+x /opt/entrypoint.sh
COPY config/deb/mirror.list /etc/apt/mirror.list
VOLUME ["/data/"]
ENTRYPOINT ["/opt/entrypoint.sh"]

10
Dockerfile.rpm Normal file
View File

@@ -0,0 +1,10 @@
FROM fedora:38
RUN yum -y install createrepo yum-utils
RUN mkdir /data/ /etc/yum.repos.d/mirror/
COPY config/rpm/entrypoint.sh /opt/entrypoint.sh
COPY config/rpm/repo_files/* /etc/yum.repos.d/mirror/
VOLUME ["/data/"]
ENTRYPOINT ["/opt/entrypoint.sh"]

View File

@@ -2,6 +2,10 @@
Right now there's only `rpm` repository mirroring container. `deb` will be added later based on `ubuntu`.
docker build -t rpmmirror:latest .
docker run -v "$(pwd)/mirror_data":/data rpmmirror:latest
docker build -t rpmmirror:latest -f Dockerfile.rpm .
docker run -v "$(pwd)/data/rpm":/data rpmmirror:latest
Here is the `deb` container version:
docker build -t debmirror:latest -f Dockerfile.deb .
docker run -v "$(pwd)/data/deb":/data debmirror:latest

3
config/deb/entrypoint.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
apt-mirror

33
config/deb/mirror.list Normal file
View File

@@ -0,0 +1,33 @@
############# config ##################
#
set base_path /data/
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/6.0 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/5.0 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.2 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse
clean http://archive.ubuntu.com/ubuntu

23
config/rpm/entrypoint.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
for repo_file in $(ls -1 /etc/yum.repos.d/mirror/)
do
dnf config-manager --add-repo /etc/yum.repos.d/mirror/$repo_file
done
# for gpg_key in $(find /tmp/gpg_keys)
# do
# rpm --import /tmp/gpg_keys/$gpg_key
# done
for cent_release in 6 7 8
do
for mongo_release in 4.4 5.0 6.0
do
reposync --delete \
--remote-time \
--download-metadata \
-p /data/ \
--repoid mongodb-org-$mongo_release-c$cent_release
done
done

View File

@@ -1,22 +0,0 @@
#!/bin/bash
for repo_file in $(ls -1 /etc/yum.repos.d/mirror/)
do
dnf config-manager --add-repo /etc/yum.repos.d/mirror/$repo_file
done
for gpg_key in $(find /tmp/gpg_keys)
do
done
for cent_release in 6 7 8
do
for mongo_release in 4.4 5.0 6.0
do
reposync --delete --remote-time --download-metadata -p /data/ --repoid mongodb-org-$mongo_release-c$cent_release
done
done
# reposync -g -m --repoid=base --newest-only --download-metadata --download_path=/data/
# reposync -g -m --repoid=centosplus --newest-only --download-metadata --download_path=/data/
# reposync -g -m --repoid=extras --newest-only --download-metadata --download_path=/data/
# reposync -g -m --repoid=updates --newest-only --download-metadata --download_path=/data/