diff --git a/dockerfiles/yum-sync/Dockerfile b/dockerfiles/yum-sync/Dockerfile new file mode 100644 index 0000000..feefc01 --- /dev/null +++ b/dockerfiles/yum-sync/Dockerfile @@ -0,0 +1,10 @@ +FROM centos:8 +MAINTAINER Hongren Zheng + +RUN dnf makecache && \ + dnf install -y 'dnf-command(reposync)' createrepo_c wget curl + +RUN mkdir -p /home/tunasync-scripts + +ENV HOME=/tmp +CMD /bin/bash diff --git a/yum-sync.py b/yum-sync.py index 280d3ac..9f22825 100755 --- a/yum-sync.py +++ b/yum-sync.py @@ -197,6 +197,7 @@ def main(): conf.write(''' [main] keepcache=0 +cachedir={cache_dir} ''') for name, url in combination_os_comp(arch): conf.write(f''' @@ -219,7 +220,7 @@ enabled=1 failed.append(('', arch)) continue - cmd_args = ["reposync", "-a", arch, "-c", conf.name, "-d", "-p", str(args.working_dir.absolute()), "-e", cache_dir] + cmd_args = ["dnf", "reposync", "-a", arch, "-c", conf.name, "--delete", "-p", str(args.working_dir.absolute())] print("Launching reposync", flush=True) # print(cmd_args) ret = sp.run(cmd_args) @@ -232,7 +233,7 @@ enabled=1 if args.download_repodata: download_repodata(url, path) else: - cmd_args = ["createrepo", "--update", "-v", "-c", cache_dir, "-o", str(path), str(path)] + cmd_args = ["createrepo_c", "--update", "-v", "-c", cache_dir, "-o", str(path), str(path)] # print(cmd_args) ret = sp.run(cmd_args) calc_repo_size(path)