[UPDATE] - script init dl sync repo

This commit is contained in:
Prof Isen 2021-12-01 17:02:06 +01:00
parent 12d54c0d06
commit a777a41045
4 changed files with 3155 additions and 0 deletions

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM centos:7.9.2009
ENV container docker
RUN echo coucou
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
VOLUME [ "/sys/fs/cgroup" ]
RUN yum install yum-utils createrepo vim -y
RUN yum install epel-release -y
COPY ./bin/sync.sh /bin/sync.sh
RUN chmod 755 /bin/sync.sh
#CMD ["/usr/sbin/init"]
CMD ["/bin/sync.sh"]

10
bin/sync.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
[[ ! -d /data/log ]] && mkdir /data/log
[[ ! -d /data/repo ]] && mkdir /data/repo
for Repo in $(yum repolist | grep x86_64 | awk -F'/' '{print $1}')
do
echo "$Repo"
reposync --gpgcheck -l --repoid=${Repo} --download_path=/data/repo/ | tee /data/log/${Repo}.log
done

3119
data/log/base.log Normal file

File diff suppressed because it is too large Load Diff

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
version: '2'
services:
c7repo:
image: c7repo
volumes:
- ./data:/data