Skip to content

adoroszlai/docker-yum-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy YUM repos

Docker image to copy YUM repos (one-time mirror to local disk).

See also docker-apt-mirror for copying APT repos.

Usage

Define (customize) the following variables:

REPO_DIR=~/data/repos
REPO_HOST=repo
  • REPO_DIR: the directory on the host where repos are mirrored to
  • REPO_HOST: the name of the host that serves local repos (add this to /etc/hosts with the appropriate IP)

Copy full YUM repo

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

Download only some packages

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*"

Generate local repo file

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

Download specific files

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]

Serve local repos

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

Releases

No releases published

Packages

No packages published