Patchwork [09,of,10,v2] docker: add CentOS 5

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 31, 2014, 11:41 a.m.
Message ID <f092f5ea6a405d1af342.1409485299@localhost.localdomain>
Download mbox | patch
Permalink /patch/5666/
State Accepted
Headers show

Comments

Mads Kiilerich - Aug. 31, 2014, 11:41 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1400111317 -7200
#      Thu May 15 01:48:37 2014 +0200
# Node ID f092f5ea6a405d1af342f605ff13e9357d81d6ca
# Parent  4d93a80727da8b53f1c7248c69d5271136b8b5d4
docker: add CentOS 5

There is no official CentOS 5 docker template so we use one from saltstack.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -153,6 +153,16 @@  docker-fedora20:
 	mkdir -p packages/fedora20
 	contrib/dockerrpm fedora20
 
+centos5:
+	mkdir -p packages/centos5
+	contrib/buildrpm --withpython
+	cp rpmbuild/RPMS/*/* packages/centos5
+	cp rpmbuild/SRPMS/* packages/centos5
+
+docker-centos5:
+	mkdir -p packages/centos5
+	contrib/dockerrpm centos5 --withpython
+
 centos6:
 	mkdir -p packages/centos6
 	contrib/buildrpm
diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
new file mode 100644
--- /dev/null
+++ b/contrib/docker/centos5
@@ -0,0 +1,4 @@ 
+FROM saltstack/centos-5-minimal
+RUN yum install -y gcc make rpm-build gettext tar
+RUN yum install -y python-devel python-docutils
+RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -18,6 +18,7 @@  fi
 
 PLATFORM="$1"
 [ "$PLATFORM" ] || { echo "Error: platform name must be specified"; exit 1; }
+shift # extra params are passed to buildrpm
 
 DFILE="$ROOTDIR/contrib/docker/$PLATFORM"
 [ -f "$DFILE" ] || { echo "Error: docker file $DFILE not found"; exit 1; }
@@ -32,7 +33,7 @@  echo RUN useradd $DBUILDUSER -u `id -u` 
 ) | $DOCKER build --tag $CONTAINER -
 
 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
-contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare
+contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
 
 DSHARED=/mnt/shared
 $DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \