2015-04-30 18:30:42 -04:00
|
|
|
Name: docker-engine
|
|
|
|
Version: %{_version}
|
|
|
|
Release: %{_release}%{?dist}
|
|
|
|
Summary: The open-source application container engine
|
2015-07-07 03:08:55 -04:00
|
|
|
Group: Tools/Docker
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
License: ASL 2.0
|
|
|
|
Source: %{name}.tar.gz
|
|
|
|
|
2015-06-03 15:08:40 -04:00
|
|
|
URL: https://dockerproject.org
|
2015-04-30 18:30:42 -04:00
|
|
|
Vendor: Docker
|
|
|
|
Packager: Docker <support@docker.com>
|
|
|
|
|
|
|
|
# is_systemd conditional
|
2016-01-15 18:46:56 -05:00
|
|
|
%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
|
2015-04-30 18:30:42 -04:00
|
|
|
%global is_systemd 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# required packages for build
|
2015-11-23 14:00:43 -05:00
|
|
|
# most are already in the container (see contrib/builder/rpm/ARCH/generate.sh)
|
2015-04-30 18:30:42 -04:00
|
|
|
# only require systemd on those systems
|
|
|
|
%if 0%{?is_systemd}
|
2016-01-15 18:46:56 -05:00
|
|
|
%if 0%{?suse_version} >= 1210
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
%{?systemd_requires}
|
|
|
|
%else
|
2015-04-30 18:30:42 -04:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
Requires: systemd-units
|
2015-09-15 16:13:22 -04:00
|
|
|
BuildRequires: pkgconfig(libsystemd-journal)
|
|
|
|
%endif
|
2015-04-30 18:30:42 -04:00
|
|
|
%else
|
|
|
|
Requires(post): chkconfig
|
|
|
|
Requires(preun): chkconfig
|
|
|
|
# This is for /sbin/service
|
|
|
|
Requires(preun): initscripts
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# required packages on install
|
|
|
|
Requires: /bin/sh
|
|
|
|
Requires: iptables
|
2016-01-15 18:46:56 -05:00
|
|
|
%if !0%{?suse_version}
|
2015-04-30 18:30:42 -04:00
|
|
|
Requires: libcgroup
|
2016-01-15 18:46:56 -05:00
|
|
|
%else
|
|
|
|
Requires: libcgroup1
|
|
|
|
%endif
|
2015-04-30 18:30:42 -04:00
|
|
|
Requires: tar
|
|
|
|
Requires: xz
|
2015-10-29 18:23:44 -04:00
|
|
|
%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7
|
2015-04-30 18:30:42 -04:00
|
|
|
# Resolves: rhbz#1165615
|
|
|
|
Requires: device-mapper-libs >= 1.02.90-1
|
|
|
|
%endif
|
2016-01-07 16:09:47 -05:00
|
|
|
%if 0%{?oraclelinux} >= 6
|
|
|
|
# Require Oracle Unbreakable Enterprise Kernel R4 and newer device-mapper
|
|
|
|
Requires: kernel-uek >= 4.1
|
2015-07-10 19:53:00 -04:00
|
|
|
Requires: device-mapper >= 1.02.90-2
|
|
|
|
%endif
|
2015-04-30 18:30:42 -04:00
|
|
|
|
2015-08-25 15:04:01 -04:00
|
|
|
# docker-selinux conditional
|
2015-08-25 15:46:35 -04:00
|
|
|
%if 0%{?fedora} >= 20 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7
|
2015-08-25 15:04:01 -04:00
|
|
|
%global with_selinux 1
|
|
|
|
%endif
|
|
|
|
|
2016-04-15 12:48:53 -04:00
|
|
|
# DWZ problem with multiple golang binary, see bug
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
|
|
|
|
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7
|
|
|
|
%global _dwz_low_mem_die_limit 0
|
|
|
|
%endif
|
|
|
|
|
2015-08-25 15:04:01 -04:00
|
|
|
# start if with_selinux
|
|
|
|
%if 0%{?with_selinux}
|
|
|
|
# Version of SELinux we were using
|
2015-08-25 15:46:35 -04:00
|
|
|
%if 0%{?fedora} == 20
|
|
|
|
%global selinux_policyver 3.12.1-197
|
|
|
|
%endif # fedora 20
|
|
|
|
%if 0%{?fedora} == 21
|
|
|
|
%global selinux_policyver 3.13.1-105
|
|
|
|
%endif # fedora 21
|
2015-08-25 15:04:01 -04:00
|
|
|
%if 0%{?fedora} >= 22
|
2015-08-25 15:46:35 -04:00
|
|
|
%global selinux_policyver 3.13.1-128
|
|
|
|
%endif # fedora 22
|
|
|
|
%if 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7
|
|
|
|
%global selinux_policyver 3.13.1-23
|
|
|
|
%endif # centos,oraclelinux 7
|
2015-08-25 15:04:01 -04:00
|
|
|
%endif # with_selinux
|
|
|
|
|
|
|
|
# RE: rhbz#1195804 - ensure min NVR for selinux-policy
|
|
|
|
%if 0%{?with_selinux}
|
|
|
|
Requires: selinux-policy >= %{selinux_policyver}
|
2016-07-01 17:28:19 -04:00
|
|
|
Requires(pre): %{name}-selinux >= %{version}-%{release}
|
2015-08-25 15:04:01 -04:00
|
|
|
%endif # with_selinux
|
|
|
|
|
2015-04-30 18:30:42 -04:00
|
|
|
# conflicting packages
|
|
|
|
Conflicts: docker
|
|
|
|
Conflicts: docker-io
|
2015-11-04 20:17:37 -05:00
|
|
|
Conflicts: docker-engine-cs
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
%description
|
2015-08-09 21:34:10 -04:00
|
|
|
Docker is an open source project to build, ship and run any application as a
|
|
|
|
lightweight container.
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
Docker containers are both hardware-agnostic and platform-agnostic. This means
|
|
|
|
they can run anywhere, from your laptop to the largest EC2 compute instance and
|
|
|
|
everything in between - and they don't require you to use a particular
|
|
|
|
language, framework or packaging system. That makes them great building blocks
|
|
|
|
for deploying and scaling web apps, databases, and backend services without
|
|
|
|
depending on a particular stack or provider.
|
|
|
|
|
|
|
|
%prep
|
2016-01-07 19:06:21 -05:00
|
|
|
%if 0%{?centos} <= 6 || 0%{?oraclelinux} <=6
|
2015-04-30 18:30:42 -04:00
|
|
|
%setup -n %{name}
|
|
|
|
%else
|
|
|
|
%autosetup -n %{name}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%build
|
2015-09-15 16:13:22 -04:00
|
|
|
export DOCKER_GITCOMMIT=%{_gitcommit}
|
2015-04-30 18:30:42 -04:00
|
|
|
./hack/make.sh dynbinary
|
2015-06-08 13:48:20 -04:00
|
|
|
# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
%check
|
2016-02-19 17:42:51 -05:00
|
|
|
./bundles/%{_origversion}/dynbinary-client/docker -v
|
|
|
|
./bundles/%{_origversion}/dynbinary-daemon/dockerd -v
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
%install
|
|
|
|
# install binary
|
|
|
|
install -d $RPM_BUILD_ROOT/%{_bindir}
|
2016-02-19 17:42:51 -05:00
|
|
|
install -p -m 755 bundles/%{_origversion}/dynbinary-client/docker-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/docker
|
|
|
|
install -p -m 755 bundles/%{_origversion}/dynbinary-daemon/dockerd-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/dockerd
|
2016-06-03 12:28:14 -04:00
|
|
|
install -p -m 755 bundles/%{_origversion}/dynbinary-daemon/docker-proxy-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/docker-proxy
|
2015-04-30 18:30:42 -04:00
|
|
|
|
2016-03-21 20:37:31 -04:00
|
|
|
# install containerd
|
|
|
|
install -p -m 755 /usr/local/bin/containerd $RPM_BUILD_ROOT/%{_bindir}/docker-containerd
|
|
|
|
install -p -m 755 /usr/local/bin/containerd-shim $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-shim
|
|
|
|
install -p -m 755 /usr/local/bin/ctr $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-ctr
|
|
|
|
|
|
|
|
# install runc
|
2016-04-13 09:49:40 -04:00
|
|
|
install -p -m 755 /usr/local/sbin/runc $RPM_BUILD_ROOT/%{_bindir}/docker-runc
|
2016-03-21 20:37:31 -04:00
|
|
|
|
2015-04-30 18:30:42 -04:00
|
|
|
# install udev rules
|
|
|
|
install -d $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d
|
2015-12-04 10:31:44 -05:00
|
|
|
install -p -m 644 contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/80-docker.rules
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
# add init scripts
|
|
|
|
install -d $RPM_BUILD_ROOT/etc/sysconfig
|
|
|
|
install -d $RPM_BUILD_ROOT/%{_initddir}
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?is_systemd}
|
|
|
|
install -d $RPM_BUILD_ROOT/%{_unitdir}
|
|
|
|
install -p -m 644 contrib/init/systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service
|
|
|
|
install -p -m 644 contrib/init/systemd/docker.socket $RPM_BUILD_ROOT/%{_unitdir}/docker.socket
|
2015-09-09 17:13:57 -04:00
|
|
|
%else
|
2015-04-30 18:30:42 -04:00
|
|
|
install -p -m 644 contrib/init/sysvinit-redhat/docker.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/docker
|
|
|
|
install -p -m 755 contrib/init/sysvinit-redhat/docker $RPM_BUILD_ROOT/%{_initddir}/docker
|
2015-09-09 17:13:57 -04:00
|
|
|
%endif
|
2015-10-18 01:47:57 -04:00
|
|
|
# add bash, zsh, and fish completions
|
2015-04-30 18:30:42 -04:00
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions
|
2015-10-18 01:47:57 -04:00
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/fish/vendor_completions.d
|
2015-04-30 18:30:42 -04:00
|
|
|
install -p -m 644 contrib/completion/bash/docker $RPM_BUILD_ROOT/usr/share/bash-completion/completions/docker
|
|
|
|
install -p -m 644 contrib/completion/zsh/_docker $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions/_docker
|
2015-10-18 01:47:57 -04:00
|
|
|
install -p -m 644 contrib/completion/fish/docker.fish $RPM_BUILD_ROOT/usr/share/fish/vendor_completions.d/docker.fish
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
# install manpages
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
2015-06-08 13:48:20 -04:00
|
|
|
install -p -m 644 man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1
|
2015-04-30 18:30:42 -04:00
|
|
|
install -d %{buildroot}%{_mandir}/man5
|
2015-06-08 13:48:20 -04:00
|
|
|
install -p -m 644 man/man5/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5
|
2016-06-03 09:27:24 -04:00
|
|
|
install -d %{buildroot}%{_mandir}/man8
|
2016-06-08 16:21:21 -04:00
|
|
|
install -p -m 644 man/man8/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
# add vimfiles
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/ftdetect
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/syntax
|
|
|
|
install -p -m 644 contrib/syntax/vim/doc/dockerfile.txt $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc/dockerfile.txt
|
|
|
|
install -p -m 644 contrib/syntax/vim/ftdetect/dockerfile.vim $RPM_BUILD_ROOT/usr/share/vim/vimfiles/ftdetect/dockerfile.vim
|
|
|
|
install -p -m 644 contrib/syntax/vim/syntax/dockerfile.vim $RPM_BUILD_ROOT/usr/share/vim/vimfiles/syntax/dockerfile.vim
|
|
|
|
|
2015-05-06 17:30:02 -04:00
|
|
|
# add nano
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/nano
|
|
|
|
install -p -m 644 contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/share/nano/Dockerfile.nanorc
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
# list files owned by the package here
|
|
|
|
%files
|
2015-09-25 03:44:11 -04:00
|
|
|
%doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md
|
2015-04-30 18:30:42 -04:00
|
|
|
/%{_bindir}/docker
|
2016-05-04 23:45:22 -04:00
|
|
|
/%{_bindir}/dockerd
|
2016-03-21 20:37:31 -04:00
|
|
|
/%{_bindir}/docker-containerd
|
|
|
|
/%{_bindir}/docker-containerd-shim
|
|
|
|
/%{_bindir}/docker-containerd-ctr
|
2016-07-08 09:15:57 -04:00
|
|
|
/%{_bindir}/docker-proxy
|
2016-03-21 20:37:31 -04:00
|
|
|
/%{_bindir}/docker-runc
|
2015-04-30 18:30:42 -04:00
|
|
|
/%{_sysconfdir}/udev/rules.d/80-docker.rules
|
|
|
|
%if 0%{?is_systemd}
|
|
|
|
/%{_unitdir}/docker.service
|
|
|
|
/%{_unitdir}/docker.socket
|
2015-09-09 17:13:57 -04:00
|
|
|
%else
|
2015-09-16 23:34:08 -04:00
|
|
|
%config(noreplace,missingok) /etc/sysconfig/docker
|
2015-04-30 18:30:42 -04:00
|
|
|
/%{_initddir}/docker
|
2015-09-09 17:13:57 -04:00
|
|
|
%endif
|
2015-04-30 18:30:42 -04:00
|
|
|
/usr/share/bash-completion/completions/docker
|
|
|
|
/usr/share/zsh/vendor-completions/_docker
|
2015-10-18 01:47:57 -04:00
|
|
|
/usr/share/fish/vendor_completions.d/docker.fish
|
2015-04-30 18:30:42 -04:00
|
|
|
%doc
|
|
|
|
/%{_mandir}/man1/*
|
|
|
|
/%{_mandir}/man5/*
|
2016-06-03 09:27:24 -04:00
|
|
|
/%{_mandir}/man8/*
|
2015-04-30 18:30:42 -04:00
|
|
|
/usr/share/vim/vimfiles/doc/dockerfile.txt
|
|
|
|
/usr/share/vim/vimfiles/ftdetect/dockerfile.vim
|
|
|
|
/usr/share/vim/vimfiles/syntax/dockerfile.vim
|
2015-05-06 17:30:02 -04:00
|
|
|
/usr/share/nano/Dockerfile.nanorc
|
2015-04-30 18:30:42 -04:00
|
|
|
|
|
|
|
%post
|
|
|
|
%if 0%{?is_systemd}
|
|
|
|
%systemd_post docker
|
|
|
|
%else
|
|
|
|
# This adds the proper /etc/rc*.d links for the script
|
|
|
|
/sbin/chkconfig --add docker
|
|
|
|
%endif
|
|
|
|
if ! getent group docker > /dev/null; then
|
|
|
|
groupadd --system docker
|
|
|
|
fi
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%if 0%{?is_systemd}
|
|
|
|
%systemd_preun docker
|
|
|
|
%else
|
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
/sbin/service docker stop >/dev/null 2>&1
|
|
|
|
/sbin/chkconfig --del docker
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%if 0%{?is_systemd}
|
|
|
|
%systemd_postun_with_restart docker
|
|
|
|
%else
|
|
|
|
if [ "$1" -ge "1" ] ; then
|
|
|
|
/sbin/service docker condrestart >/dev/null 2>&1 || :
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|