summaryrefslogtreecommitdiffstats
path: root/build/os/centos/rhel6
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-09-08 07:47:19 -0400
committerbaigk <baiguoku@huawei.com>2015-09-08 08:24:09 -0400
commitcf87d3067a63cb8be315a3addfd9c27d86be3b5a (patch)
tree861d46aebc75c73cc13a19fecfb5c48aa88a56a1 /build/os/centos/rhel6
parent633175ed2c5d0ab339027ba0a542bcdd4d3769c0 (diff)
Build improvement for speedup and using public repo
JIRA: COMPASS-19 Change-Id: Iba101807e1bd2f843f1253791b7e87e1acb7934b Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'build/os/centos/rhel6')
-rw-r--r--build/os/centos/rhel6/base.repo52
-rw-r--r--build/os/centos/rhel6/compass/Dockerfile.tmpl32
2 files changed, 84 insertions, 0 deletions
diff --git a/build/os/centos/rhel6/base.repo b/build/os/centos/rhel6/base.repo
new file mode 100644
index 00000000..e1ea7c4b
--- /dev/null
+++ b/build/os/centos/rhel6/base.repo
@@ -0,0 +1,52 @@
+# CentOS-Base.repo
+#
+# The mirror system uses the connecting IP address of the client and the
+# update status of each mirror to pick mirrors that are updated to and
+# geographically close to the client. You should use this for CentOS updates
+# unless you are manually picking other mirrors.
+#
+# If the mirrorlist= does not work for you, as a fall back you can try the
+# remarked out baseurl= line instead.
+#
+#
+
+[base]
+name=CentOS-$releasever - Base - 163.com
+baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
+#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
+
+#released updates
+[updates]
+name=CentOS-$releasever - Updates - 163.com
+baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
+#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras - 163.com
+baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
+#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
+
+#additional packages that extend functionality of existing packages
+[centosplus]
+name=CentOS-$releasever - Plus - 163.com
+baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
+#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
+
+#contrib - packages by Centos Users
+[contrib]
+name=CentOS-$releasever - Contrib - 163.com
+baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
+#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
diff --git a/build/os/centos/rhel6/compass/Dockerfile.tmpl b/build/os/centos/rhel6/compass/Dockerfile.tmpl
new file mode 100644
index 00000000..285ca098
--- /dev/null
+++ b/build/os/centos/rhel6/compass/Dockerfile.tmpl
@@ -0,0 +1,32 @@
+FROM centos:6.6
+MAINTAINER Chigang(Justin) <chigang@huawei.com>
+
+# TODO: Is there some easy way to get the fastest/closest mirror?
+# RUN sed -i 's/archive.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list
+RUN rm -f /etc/yum.repos.d/*
+ADD ./centos6/base.repo /etc/yum.repos.d/
+RUN yum update -y
+
+# set cache enable
+RUN sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf
+#set packages = $getVar('spcial_packages', [])
+#for package in $packages
+ADD $packages /var/cache/yum/x86_64/7/base/packages/
+#end for
+#set scripts = $getVar('scripts', [])
+#set dir = $getVar('dir', ".")
+#for script in $scripts
+ADD $dir/$script /tmp/chigang/$script
+RUN chmod +x /tmp/chigang/$script
+RUN /tmp/chigang/$script
+#end for
+ADD ./install_packages.sh /tmp/chigang/install_packages.sh
+RUN chmod +x /tmp/chigang/install_packages.sh
+RUN /tmp/chigang/install_packages.sh
+
+ADD ./cp_repo.sh /tmp/chigang/cp_repo.sh
+RUN chmod +x /tmp/chigang/cp_repo.sh
+RUN mkdir /result
+
+CMD ["/tmp/chigang/cp_repo.sh"]
+#VOLUME /tmp/chigang