Docker image to copy YUM repos (one-time mirror to local disk).
See also docker-apt-mirror for copying APT repos.
Define (customize) the following variables:
REPO_DIR=~/data/repos
REPO_HOST=repo
REPO_DIR
: the directory on the host where repos are mirrored toREPO_HOST
: the name of the host that serves local repos (add this to/etc/hosts
with the appropriate IP)
docker run --rm -v ${REPO_DIR}:/var/repo -e REPO_HOST copy-yum-repo \
repo http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.0.0/ambari.repo \
[more URLs]
A local version of the repo file is also created with URLs changed to point to ${REPO_HOST}
, eg.:
#VERSION_NUMBER=2.7.0.0-897
[ambari-2.7.0.0]
#json.url = http://repo/public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
name=ambari Version - ambari-2.7.0.0
baseurl=http://repo/public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.0.0
gpgcheck=1
gpgkey=http://repo/public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.0.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
docker run --rm -v ${REPO_DIR}:/var/repo -e REPO_HOST copy-yum-repo \
pkg http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.5.0.0/hdp.repo \
"kafka*" "zookeeper*"
docker run --rm -v ${REPO_DIR}:/var/repo copy-yum-repo \
repo-file ${REPO_HOST} http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.2/ambari.repo
docker run --rm -v ${REPO_DIR}:/var/repo copy-yum-repo \
file http://public-repo-1.hortonworks.com/HDF/centos7/3.x/updates/3.1.0.0/tars/hdf_ambari_mp/hdf-ambari-mpack-3.1.0.0-564.tar.gz \
[more URLs]
Local repos can be served by running nginx or some other web server.
docker run -d --name ${REPO_HOST} -p 80:80 -h ${REPO_HOST} -v ${REPO_DIR}:/usr/share/nginx/html:ro nginx:alpine