Quellcode durchsuchen

Add rpm builder for VMware Photon OS

Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
Fabio Rapposelli vor 9 Jahren
Ursprung
Commit
6c7e1863d5

+ 10 - 0
contrib/builder/rpm/amd64/generate.sh

@@ -25,6 +25,9 @@ for version in "${versions[@]}"; do
 	if [[ "$distro" == "fedora" ]]; then
 		installer=dnf
 	fi
+	if [[ "$distro" == "photon" ]]; then
+		installer=tdnf
+	fi
 
 	mkdir -p "$version"
 	echo "$version -> FROM $from"
@@ -70,6 +73,9 @@ for version in "${versions[@]}"; do
 			# get rpm-build and curl packages and dependencies
 			echo 'RUN zypper --non-interactive install ca-certificates* curl gzip rpm-build' >> "$version/Dockerfile"
 			;;
+		photon:*)
+			echo "RUN ${installer} install -y wget curl ca-certificates gzip make rpm-build sed gcc linux-api-headers glibc-devel binutils libseccomp libltdl-devel elfutils" >> "$version/Dockerfile"
+			;;
 		*)
 			echo "RUN ${installer} install -y @development-tools fedora-packager" >> "$version/Dockerfile"
 			;;
@@ -129,6 +135,10 @@ for version in "${versions[@]}"; do
 			# use zypper
 			echo "RUN zypper --non-interactive install ${packages[*]}" >> "$version/Dockerfile"
 			;;
+		photon:*)
+			packages=( "${packages[@]/pkgconfig/pkg-config}" )
+			echo "RUN ${installer} install -y ${packages[*]}" >> "$version/Dockerfile"
+			;;
 		*)
 			echo "RUN ${installer} install -y ${packages[*]}" >> "$version/Dockerfile"
 			;;

+ 18 - 0
contrib/builder/rpm/amd64/photon-1.0/Dockerfile

@@ -0,0 +1,18 @@
+#
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/amd64/generate.sh"!
+#
+
+FROM photon:1.0
+
+RUN tdnf install -y wget curl ca-certificates gzip make rpm-build sed gcc linux-api-headers glibc-devel binutils libseccomp libltdl-devel elfutils
+RUN tdnf install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel pkg-config selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar git
+
+ENV GO_VERSION 1.7
+RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
+ENV PATH $PATH:/usr/local/go/bin
+
+ENV AUTO_GOPATH 1
+
+ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux
+ENV RUNC_BUILDTAGS seccomp selinux
+

+ 15 - 2
hack/install.sh

@@ -141,7 +141,7 @@ do_install() {
 	esac
 
 	if command_exists docker; then
-		version="$(docker -v | awk -F '[ ,]+' '{ print $3 }')"
+		version="$(docker -v | cut -d ' ' -f3 | cut -d ',' -f1)"
 		MAJOR_W=1
 		MINOR_W=10
 
@@ -247,6 +247,9 @@ do_install() {
 	if [ -z "$lsb_dist" ] && [ -r /etc/redhat-release ]; then
 		lsb_dist='redhat'
 	fi
+	if [ -z "$lsb_dist" ] && [ -r /etc/photon-release ]; then
+		lsb_dist='photon'
+	fi
 	if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then
 		lsb_dist="$(. /etc/os-release && echo "$ID")"
 	fi
@@ -292,6 +295,11 @@ do_install() {
 			dist_version="$(rpm -q --whatprovides ${lsb_dist}-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//' | sort | tail -1)"
 		;;
 
+		"vmware photon")
+			lsb_dist="photon"
+			dist_version="$(. /etc/os-release && echo "$VERSION_ID")"
+		;;
+
 		*)
 			if command_exists lsb_release; then
 				dist_version="$(lsb_release --codename | cut -f2)"
@@ -450,7 +458,7 @@ do_install() {
 			exit 0
 			;;
 
-		fedora|centos|redhat|oraclelinux)
+		fedora|centos|redhat|oraclelinux|photon)
 			if [ "${lsb_dist}" = "redhat" ]; then
 				# we use the centos repository for both redhat and centos releases
 				lsb_dist='centos'
@@ -468,6 +476,11 @@ do_install() {
 					set -x
 					$sh_c 'sleep 3; dnf -y -q install docker-engine'
 				)
+			elif [ "$lsb_dist" = "photon" ]; then
+				(
+					set -x
+					$sh_c 'sleep 3; tdnf -y install docker-engine'
+				)
 			else
 				(
 					set -x