[docker-io/f19] enable selinux, remove conditionals

Lokesh Mandvekar lsm5 at fedoraproject.org
Tue May 13 14:11:40 UTC 2014


commit 4bf6f207adfd7904bcc45a8ed6ea03c4b267b114
Author: Lokesh Mandvekar <lsm5 at redhat.com>
Date:   Tue May 13 10:11:23 2014 -0400

    enable selinux, remove conditionals

 docker-0.9-el6-lxc.patch    |   13 ---
 docker-io.spec              |   74 ++------------
 docker.service              |   13 +++
 ignore-btrfs-for-rhel.patch |  233 -------------------------------------------
 4 files changed, 25 insertions(+), 308 deletions(-)
---
diff --git a/docker-io.spec b/docker-io.spec
index 17ffffd..b61f455 100644
--- a/docker-io.spec
+++ b/docker-io.spec
@@ -1,7 +1,3 @@
-%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
-%bcond_without  systemd
-%endif
-
 # modifying the dockerinit binary breaks the SHA1 sum check by docker
 %global __os_install_post %{_rpmconfigdir}/brp-compress
 
@@ -14,18 +10,16 @@
 
 Name:           docker-io
 Version:        0.11.1
-Release:        1%{?dist}
+Release:        3%{?dist}
 Summary:        Automates deployment of containerized applications
 License:        ASL 2.0
 
-Patch0:         ignore-btrfs-for-rhel.patch
 Patch1:         upstream-patched-archive-tar.patch
-
-Patch90:        docker-0.9-el6-lxc.patch
 URL:            http://www.docker.io
 # only x86_64 for now: https://github.com/dotcloud/docker/issues/136
 ExclusiveArch:  x86_64
 Source0:        https://github.com/dotcloud/docker/archive/v%{version}.tar.gz
+Source1:        docker.service
 # though final name for sysconf/sysvinit files is simply 'docker',
 # having .sysvinit and .sysconfig makes things clear
 BuildRequires:  gcc
@@ -44,39 +38,19 @@ BuildRequires:  golang(code.google.com/p/gosqlite/sqlite3)
 BuildRequires:  golang(github.com/syndtr/gocapability/capability)
 BuildRequires:  device-mapper-devel
 
-# btrfs not available for rhel yet
-%if 0%{?fedora}
 BuildRequires:  btrfs-progs-devel
-%endif
 
-%if %{with systemd}
 BuildRequires:  pkgconfig(systemd)
 
 # Build upstream docs with pandoc
 BuildRequires:  pandoc
 
 Requires:       systemd-units
-%else
-Requires(post):     chkconfig
-Requires(preun):    chkconfig
-Requires(postun):   initscripts
-%endif
 
 # need xz to work with ubuntu images
 # https://bugzilla.redhat.com/show_bug.cgi?id=1045220
 Requires:       xz
 
-# https://bugzilla.redhat.com/show_bug.cgi?id=1035436
-# this won't be needed for rhel7+
-%if 0%{?rhel} >= 6 && 0%{?rhel} < 7
-Requires:       bridge-utils
-Requires:       lxc
-
-# https://bugzilla.redhat.com/show_bug.cgi?id=1034919
-# No longer needed in Fedora because of libcontainer
-Requires:       libcgroup
-%endif
-
 Provides:       lxc-docker = %{version}
 
 %description
@@ -92,10 +66,6 @@ servers, OpenStack clusters, public instances, or combinations of the above.
 %prep
 %setup -q -n docker-%{version}
 rm -rf vendor
-%if 0%{?rhel}
-%patch0 -p1 -b ignore-btrfs-for-rhel
-%patch90 -p1 -b docker-0.9-el6-lxc
-%endif
 %patch1 -p1 -b upstream-patched-archive-tar
 
 %build
@@ -107,6 +77,7 @@ pushd _build
 popd
 
 export DOCKER_GITCOMMIT="%{shortcommit}/%{version}"
+export DOCKER_BUILDTAGS='selinux'
 export GOPATH=$(pwd)/_build:%{gopath}
 
 hack/make.sh dynbinary
@@ -140,45 +111,23 @@ install -d %{buildroot}%{_sysconfdir}/udev/rules.d
 install -p -m 755 contrib/udev/80-docker.rules %{buildroot}%{_sysconfdir}/udev/rules.d
 # install storage dir
 install -d -m 700 %{buildroot}%{_sharedstatedir}/docker
-# install systemd/init scripts
-%if %{with systemd}
+# install systemd unitfile
 install -d %{buildroot}%{_unitdir}
-install -p -m 644 contrib/init/systemd/docker.service %{buildroot}%{_unitdir}
-%else
-install -d %{buildroot}%{_sysconfdir}/sysconfig/
-install -p -m 644 contrib/init/sysvinit-redhat/docker.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/docker
-install -d %{buildroot}%{_initddir}
-install -p -m 755 contrib/init/sysvinit-redhat/docker %{buildroot}%{_initddir}/docker
-%endif
+#install -p -m 644 contrib/init/systemd/docker.service %{buildroot}%{_unitdir}
+install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
 
 %pre
 getent group docker > /dev/null || %{_sbindir}/groupadd -r docker
 exit 0
 
 %post
-%if %{with systemd}
 %systemd_post docker
-%else
-# install but don't activate
-/sbin/chkconfig --add docker
-%endif
 
 %preun
-%if %{with systemd}
 %systemd_preun docker
-%else
-/sbin/service docker stop >/dev/null 2>&1
-/sbin/chkconfig --del docker
-%endif
 
 %postun
-%if %{with systemd}
 %systemd_postun_with_restart docker
-%else
-if [ "$1" -ge "1" ] ; then
-        /sbin/service docker condrestart >/dev/null 2>&1 || :
-fi
-%endif
 
 %files
 %defattr(-,root,root,-)
@@ -188,12 +137,7 @@ fi
 %{_bindir}/docker
 %dir %{_libexecdir}/docker
 %{_libexecdir}/docker/dockerinit
-%if %{with systemd}
 %{_unitdir}/docker.service
-%else
-%config(noreplace) %{_sysconfdir}/sysconfig/docker
-%{_initddir}/docker
-%endif
 %dir %{_sysconfdir}/bash_completion.d
 %{_sysconfdir}/bash_completion.d/docker.bash
 %{_datadir}/zsh/site-functions/_docker
@@ -208,6 +152,12 @@ fi
 %{_datadir}/vim/vimfiles/syntax/dockerfile.vim
 
 %changelog
+* Tue May 13 2014 Lokesh Mandvekar <lsm5 at redhat.com> - 0.11.1-3
+- enable selinux
+
+* Tue May 13 2014 Lokesh Mandvekar <lsm5 at redhat.com> - 0.11.1-2
+- remove conditionals
+
 * Thu May 08 2014 Lokesh Mandvekar <lsm5 at redhat.com> - 0.11.1-1
 - Bug 1095616 - upstream bump to 0.11.1
 - manpages via pandoc
diff --git a/docker.service b/docker.service
new file mode 100644
index 0000000..1a63071
--- /dev/null
+++ b/docker.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Docker Application Container Engine
+Documentation=http://docs.docker.io
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/docker -d --selinux-enabled
+Restart=on-failure
+LimitNOFILE=1048576
+LimitNPROC=1048576
+
+[Install]
+WantedBy=multi-user.target


More information about the scm-commits mailing list