2 # abandoned, since 17.x, use docker-ce.spec
3 # https://blog.docker.com/2017/04/introducing-the-moby-project/
6 %bcond_with tests # build without tests
7 %bcond_with vim # build vim syntax package (bundled in vim 7.4.979-2)
8 %bcond_with doc # build manual pages
11 # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
13 # v1.0.0-rc2-133-g9df8b30
14 %define runc_commit 9df8b30
16 %define containerd_commit aa8187d
17 # v0.8.0-dev.2-464-g0f53435
18 %define libnetwork_commit 0f53435
20 Summary: Docker: the open-source application container engine
25 Group: Applications/System
26 # https://github.com/docker/docker/releases
27 Source0: https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
28 # Source0-md5: 032c39b2390a0f387cdb49bab8c4c712
29 Source1: https://github.com/docker/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
30 # Source1-md5: 43ee79eaf575db8a212058c30997e45d
31 Source2: https://github.com/docker/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
32 # Source2-md5: 01c58df940b94910996ecb8096fd8b71
33 Source3: https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
34 # Source3-md5: 7cfbfe76355aae3577c77a6a4b2c92db
35 Source4: https://github.com/krallin/tini/archive/v0.13.0/tini-0.13.0.tar.gz
36 # Source4-md5: c29541112a242c53c82bb6b1213f288f
39 Source8: %{name}.sysconfig
41 URL: http://www.docker.com/
42 BuildRequires: btrfs-progs-devel >= 3.16.1
44 BuildRequires: device-mapper-devel >= 2.02.89
45 BuildRequires: golang >= 1.6
46 BuildRequires: libseccomp-devel >= 2.2.1
47 BuildRequires: rpmbuild(macros) >= 1.644
48 BuildRequires: sqlite3-devel >= 3.7.9
49 Requires(post,preun): /sbin/chkconfig
50 Requires(postun): /usr/sbin/groupdel
51 Requires(pre): /usr/bin/getgid
52 Requires(pre): /usr/sbin/groupadd
53 Requires: ca-certificates
54 Requires: iproute2 >= 3.5
56 Requires: rc-scripts >= 0.4.0.10
57 Requires: systemd-units >= 38
58 Requires: tar >= 1:1.26
59 Requires: uname(release) >= 3.8
61 Suggests: docker-credential-helpers
62 Suggests: git-core >= 1.7
65 Provides: docker(engine) = %{version}
66 Provides: group(docker)
67 Obsoletes: lxc-docker < 1.1.1
68 # only runs on x64 hosts for now:
69 # https://github.com/docker/docker/issues/136
70 # https://github.com/docker/docker/issues/611
71 ExclusiveArch: %{x8664}
72 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 %define bash_compdir %{_datadir}/bash-completion/completions
75 %define zsh_compdir %{_datadir}/zsh/site-functions
76 %define _vimdatadir %{_datadir}/vim
77 %define _libexecdir %{_prefix}/lib
79 # binary stripped or something
80 %define _enable_debug_packages 0
83 Docker is an open source project to pack, ship and run any application
84 as a lightweight container
86 Docker containers are both hardware-agnostic and platform-agnostic.
87 This means that they can run anywhere, from your laptop to the largest
88 EC2 compute instance and everything in between - and they don't
89 require that you use a particular language, framework or packaging
90 system. That makes them great building blocks for deploying and
91 scaling web apps, databases and backend services without depending on
92 a particular stack or provider.
94 Docker is an open-source implementation of the deployment engine which
95 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
96 from the experience accumulated over several years of large-scale
97 operation and support of hundreds of thousands of applications and
100 %package -n bash-completion-%{name}
101 Summary: bash-completion for Docker
102 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
103 Group: Applications/Shells
105 Requires: bash-completion >= 2.0
106 Obsoletes: bash-completion-lxc-docker < 1.1.1
107 %if "%{_rpmversion}" >= "5"
111 %description -n bash-completion-%{name}
112 This package provides bash-completion for Docker.
114 %description -n bash-completion-%{name} -l pl.UTF-8
115 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
117 %package -n zsh-completion-%{name}
118 Summary: zsh completion for Docker
119 Summary(pl.UTF-8): Uzupełnianie parametrów w zsh dla poleceń Dockera
120 Group: Applications/Shells
122 %if "%{_rpmversion}" >= "5"
126 %description -n zsh-completion-%{name}
127 This package provides zsh completion for Docker.
129 %description -n zsh-completion-%{name} -l pl.UTF-8
130 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
132 %package -n vim-syntax-%{name}
133 Summary: Vim syntax: Docker
134 Group: Applications/Editors/Vim
135 Requires: %{name} = %{version}-%{release}
136 Requires: vim-rt >= 4:7.2.170
137 Obsoletes: vim-syntax-lxc-docker < 1.1.1
138 %if "%{_rpmversion}" >= "5"
142 %description -n vim-syntax-%{name}
143 This plugin provides syntax highlighting in Dockerfile.
146 %setup -q %{?subver:-n %{name}-%{version}%{subver}} -a1 -a2 -a3 -a4
147 mv runc-%{runc_commit}* runc
148 mv containerd-%{containerd_commit}* containerd
149 mv libnetwork-%{libnetwork_commit}* libnetwork
153 install -d vendor/src/github.com/docker
154 ln -s $(pwd) vendor/src/github.com/docker/docker
155 ln -s $(pwd)/containerd containerd/vendor/src/github.com/docker/containerd
156 ln -s $(pwd)/libnetwork vendor/src/github.com/docker/libnetwork
159 v=$(awk -F= '/^RUNC_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
160 echo "$v" | grep "^%{runc_commit}"
161 v=$(awk -F= '/^CONTAINERD_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
162 echo "$v" | grep "^%{containerd_commit}"
163 v=$(awk -F= '/^LIBNETWORK_COMMIT/ {print $2}' hack/dockerfile/binaries-commits)
164 echo "$v" | grep "^%{libnetwork_commit}"
166 export GOPATH=$(pwd)/vendor:$(pwd)/containerd/vendor
167 export DOCKER_GITCOMMIT="pld/%{version}"
171 # build docker-containerd
172 %{__make} -C containerd
175 go build -ldflags="-linkmode=external" \
177 github.com/docker/libnetwork/cmd/proxy
185 bash -x hack/make.sh dynbinary
191 rm -rf $RPM_BUILD_ROOT
192 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
193 $RPM_BUILD_ROOT%{_libexecdir} \
194 $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
196 install -p bundles/%{version}%{?subver}/dynbinary-client/docker-%{version}%{?subver} $RPM_BUILD_ROOT%{_bindir}/docker
197 install -p bundles/%{version}%{?subver}/dynbinary-daemon/dockerd-%{version}%{?subver} $RPM_BUILD_ROOT%{_sbindir}/dockerd
199 # install docker-runc
200 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
202 # install docker-containerd
203 install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd
204 install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim
205 install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-ctr
207 # install docker-proxy
208 install -p docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
210 # install docker-init
211 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
213 cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
214 cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
215 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
216 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
217 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
220 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
221 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
223 # bash and zsh completion
224 install -d $RPM_BUILD_ROOT%{bash_compdir}
225 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
226 install -d $RPM_BUILD_ROOT%{zsh_compdir}
227 cp -p contrib/completion/zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
231 install -d $RPM_BUILD_ROOT%{_vimdatadir}
232 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
233 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
237 %groupadd -g 296 docker
240 /sbin/chkconfig --add %{name}
241 %service -n %{name} restart
242 %systemd_post %{name}.service
245 if [ "$1" = "0" ]; then
246 %service -q %{name} stop
247 /sbin/chkconfig --del %{name}
249 %systemd_preun %{name}.service
252 if [ "$1" = "0" ]; then
258 rm -rf $RPM_BUILD_ROOT
261 %defattr(644,root,root,755)
262 %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
263 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
264 %attr(754,root,root) /etc/rc.d/init.d/docker
265 %attr(755,root,root) %{_bindir}/docker
266 %attr(755,root,root) %{_sbindir}/docker-containerd
267 %attr(755,root,root) %{_sbindir}/docker-containerd-ctr
268 %attr(755,root,root) %{_sbindir}/docker-containerd-shim
269 %attr(755,root,root) %{_sbindir}/docker-init
270 %attr(755,root,root) %{_sbindir}/docker-proxy
271 %attr(755,root,root) %{_sbindir}/docker-runc
272 %attr(755,root,root) %{_sbindir}/dockerd
273 %attr(755,root,root) %{_libexecdir}/dockerd
274 %{systemdunitdir}/docker.service
275 %{systemdunitdir}/docker.socket
276 /lib/udev/rules.d/80-docker.rules
278 %dir %attr(700,root,root) /var/lib/docker
279 %dir %attr(700,root,root) /var/lib/docker/containers
280 %dir %attr(700,root,root) /var/lib/docker/execdriver
281 %dir %attr(700,root,root) /var/lib/docker/graph
282 %dir %attr(700,root,root) /var/lib/docker/image
283 %dir %attr(700,root,root) /var/lib/docker/init
284 %dir %attr(700,root,root) /var/lib/docker/network
285 %dir %attr(700,root,root) /var/lib/docker/swarm
286 %dir %attr(700,root,root) /var/lib/docker/tmp
287 %dir %attr(700,root,root) /var/lib/docker/trust
288 %dir %attr(700,root,root) /var/lib/docker/vfs
289 %dir %attr(700,root,root) /var/lib/docker/volumes
291 %files -n bash-completion-%{name}
292 %defattr(644,root,root,755)
293 %{bash_compdir}/docker
295 %files -n zsh-completion-%{name}
296 %defattr(644,root,root,755)
297 %{zsh_compdir}/_docker
300 %files -n vim-syntax-%{name}
301 %defattr(644,root,root,755)
302 %doc contrib/syntax/vim/{README.md,LICENSE}
303 %{_vimdatadir}/doc/dockerfile.txt
304 %{_vimdatadir}/ftdetect/dockerfile.vim
305 %{_vimdatadir}/syntax/dockerfile.vim