/repo-centos

Primary LanguageRubyGNU General Public License v3.0GPL-3.0

Yum package mirrors repository

This repo have source code. Builds and deploy docker images for yum package mirrors repository in a containers via yaml formatted config file.

Quick reference

Where to get help :

Where to file issues :

Maintained by :

Supported architectures : (more info)

  • amd64

Supported Docker versions :

Features

  • Supports rsync or reposync.
  • Can create a large 'all' repo (all pacakges form all repos, smushed together + generated repodata).
  • This 'all' repo can be snapshot'ed, to remain frozen in time.
  • Likewise, individual repos can be snapshot'd, freezing them in time.
  • These 'snaps' are datestamped, and created (optionally) via hardlinks, to be space efficient.
  • hardlink (the program) is also used to file-level de-dupe your repos.

A resulting directory structure :

    /mirror/
    |__ centos-7-x86_64/
    |__all
    |__all.2017-06-14
    |__os
    |__updates
    |__ centos-6_x86_64/
    ...

Build docker images

    $ docker build -t $NAME_IMAGES:$TAG_IMAGES .

Run images

    $ docker run --name $NAME_CONTAINER -d $NAME_IMAGES:$TAG_IMAGES

Run images using a volume

    $ docker run --name $NAME_CONTAINER -v /path/to/storage:/mirror -d $NAME_IMAGES:$TAG_IMAGES

or

    $ docker volume create $REPO_DATA
    $ $REPO_DATA
    $ docker run --name $NAME_CONTAINER -v $REPO_DATA:/mirror -d $NAME_IMAGES:$TAG_IMAGES

Run using a custom configuration file

    $ docker run --name $NAME_CONTAINER -v /path/to/storage:/mirror -v /path/to/config.yaml:/config.yaml -d $NAME_IMAGES:$TAG_IMAGES

Container viewing logs

    $ docker logs $NAME_CONTAINER

Container shell access

    $ docker exec -it $NAME_CONTAINER bash 

Config example :

---
:hardlink: true
:hardlink_dir: '/mirror'
:all: true
:all_name: 'all'
:datestamp_all: true
:mirror_base: '/mirror'
mirrors:
  os:
    :dist: 'centos-7-x86_64'
    :type: 'rsync'
    :url: 'rsync://mirrors.kernel.org/centos/7/os/x86_64/'
  extras:
    :dist: 'centos-7-x86_64'
    :type: 'rsync'
    :url: 'rsync://mirrors.kernel.org/centos/7/extras/x86_64/'
    :datestamp: true
    :hardlink_datestamp: true
  plus:
    :dist: 'centos-7-x86_64'
    :type: 'reposync'
    :url: 'rsync://mirrors.kernel.org/centos/7/centosplus/x86_64/'
    :dest: '/some/other/location/'
    :datestamp: true
    :link_datestamp: true