3 %bcond_with tests # build without tests
4 %bcond_with vim # build vim syntax package (bundled in vim 7.4.979-2)
5 %bcond_with doc # build manual pages
7 # TODO: drop P docker when docker-compose updated to use docker(engine) dep
10 # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
12 # v1.0.0-rc2-528-g3f2f8b84
13 %define runc_commit 3f2f8b8
15 %define containerd_commit 06b9cb3
16 # v0.8.0-dev.2-624-g7b2b1feb
17 %define libnetwork_commit 7b2b1fe
19 Summary: Docker CE: the open-source application container engine
21 # Using Docker-CE, Stay on Stable channel
22 # https://docs.docker.com/engine/installation/
26 Group: Applications/System
27 # https://github.com/docker/docker-ce/releases
28 #Source0: https://github.com/docker/docker-ce/archive/v%{version}-ce%{subver}/%{name}-%{version}-ce%{subver}.tar.gz
29 Source0: https://github.com/docker/docker-ce/archive/v%{version}-ce/%{name}-%{version}-ce.tar.gz
30 # Source0-md5: e0df90392b2daa545562342dabf181cf
31 Source1: https://github.com/docker/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
32 # Source1-md5: 0dc3b1eafba193280d6cf6ffa46c2521
33 Source2: https://github.com/containerd/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
34 # Source2-md5: 202389709618a6b181216e99718f0132
35 Source3: https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
36 # Source3-md5: a9beb9207b291373dc4e376f04056e8a
37 Source4: https://github.com/krallin/tini/archive/v0.13.0/tini-0.13.0.tar.gz
38 # Source4-md5: c29541112a242c53c82bb6b1213f288f
41 Source8: docker.sysconfig
43 URL: https://www.docker.com/community-edition/
44 BuildRequires: btrfs-progs-devel >= 3.16.1
46 BuildRequires: device-mapper-devel >= 2.02.89
47 BuildRequires: golang >= 1.6
48 BuildRequires: libseccomp-devel >= 2.2.1
49 BuildRequires: rpmbuild(macros) >= 1.644
50 BuildRequires: sqlite3-devel >= 3.7.9
51 Requires(post,preun): /sbin/chkconfig
52 Requires(postun): /usr/sbin/groupdel
53 Requires(pre): /usr/bin/getgid
54 Requires(pre): /usr/sbin/groupadd
55 Requires: ca-certificates
56 Requires: iproute2 >= 3.5
58 Requires: rc-scripts >= 0.4.0.10
59 Requires: systemd-units >= 38
60 Requires: tar >= 1:1.26
61 Requires: uname(release) >= 3.8
63 Suggests: docker-credential-helpers
64 Suggests: git-core >= 1.7
67 Provides: docker = %{version}
68 Provides: docker(engine) = %{version}
69 Provides: group(docker)
70 Obsoletes: docker < 17.0
71 Obsoletes: lxc-docker < 1.1.1
72 # only runs on x64 hosts for now:
73 # https://github.com/docker/docker/issues/136
74 # https://github.com/docker/docker/issues/611
75 ExclusiveArch: %{x8664}
76 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 %define bash_compdir %{_datadir}/bash-completion/completions
79 %define zsh_compdir %{_datadir}/zsh/site-functions
80 %define _vimdatadir %{_datadir}/vim
81 %define _libexecdir %{_prefix}/lib
83 # binary stripped or something
84 %define _enable_debug_packages 0
87 Docker is an open source project to pack, ship and run any application
88 as a lightweight container
90 Docker containers are both hardware-agnostic and platform-agnostic.
91 This means that they can run anywhere, from your laptop to the largest
92 EC2 compute instance and everything in between - and they don't
93 require that you use a particular language, framework or packaging
94 system. That makes them great building blocks for deploying and
95 scaling web apps, databases and backend services without depending on
96 a particular stack or provider.
98 Docker is an open-source implementation of the deployment engine which
99 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
100 from the experience accumulated over several years of large-scale
101 operation and support of hundreds of thousands of applications and
104 %package -n bash-completion-%{name}
105 Summary: bash-completion for Docker
106 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
107 Group: Applications/Shells
109 Requires: bash-completion >= 2.0
110 Obsoletes: bash-completion-lxc-docker < 1.1.1
111 %if "%{_rpmversion}" >= "5"
115 %description -n bash-completion-%{name}
116 This package provides bash-completion for Docker.
118 %description -n bash-completion-%{name} -l pl.UTF-8
119 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
121 %package -n zsh-completion-%{name}
122 Summary: zsh completion for Docker
123 Summary(pl.UTF-8): Uzupełnianie parametrów w zsh dla poleceń Dockera
124 Group: Applications/Shells
126 %if "%{_rpmversion}" >= "5"
130 %description -n zsh-completion-%{name}
131 This package provides zsh completion for Docker.
133 %description -n zsh-completion-%{name} -l pl.UTF-8
134 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
136 %package -n vim-syntax-%{name}
137 Summary: Vim syntax: Docker
138 Group: Applications/Editors/Vim
139 Requires: %{name} = %{version}-%{release}
140 Requires: vim-rt >= 4:7.2.170
141 Obsoletes: vim-syntax-lxc-docker < 1.1.1
142 %if "%{_rpmversion}" >= "5"
146 %description -n vim-syntax-%{name}
147 This plugin provides syntax highlighting in Dockerfile.
150 %setup -q -n %{name}-%{version}-ce%{?subver} -a1 -a2 -a3 -a4
152 mv runc-%{runc_commit}* runc
153 mv runc/vendor runc/src
154 ln -s ../../.. runc/src/github.com/opencontainers/runc
156 mv containerd-%{containerd_commit}* containerd
157 mv containerd/vendor containerd/src
158 ln -s ../../.. containerd/src/github.com/containerd/containerd
160 mv libnetwork-%{libnetwork_commit}* libnetwork
161 install -d libnetwork/gopath
162 mv libnetwork/vendor libnetwork/gopath/src
163 ln -s ../../../.. libnetwork/gopath/src/github.com/docker/libnetwork
167 install -d components/cli/.gopath/src/github.com/docker
168 ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
170 %patch0 -p1 -d components/engine
173 f=components/engine/hack/dockerfile/binaries-commits
174 v=$(awk -F= '/^RUNC_COMMIT/ {print $2}' $f)
175 echo "$v" | grep "^%{runc_commit}"
176 v=$(awk -F= '/^CONTAINERD_COMMIT/ {print $2}' $f)
177 echo "$v" | grep "^%{containerd_commit}"
178 v=$(awk -F= '/^LIBNETWORK_COMMIT/ {print $2}' $f)
179 echo "$v" | grep "^%{libnetwork_commit}"
181 export VERSION=%{version}
182 export GITCOMMIT="pld/%{version}" # for cli
183 export DOCKER_GITCOMMIT="pld/%{version}" # for engine
186 sed -i -e 's,shell git,shell false,' runc/Makefile
189 COMMIT=%{runc_commit}
192 # build docker-containerd
193 GOPATH=$(pwd)/containerd \
194 %{__make} -C containerd
198 GOPATH=$(pwd)/gopath \
199 go build -ldflags="-linkmode=external" \
201 github.com/docker/libnetwork/cmd/proxy
211 GOPATH=$(pwd)/.gopath \
217 bash -x hack/make.sh dynbinary
218 ./bundles/latest/dynbinary-daemon/dockerd -v
224 rm -rf $RPM_BUILD_ROOT
225 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
226 $RPM_BUILD_ROOT%{_libexecdir} \
227 $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
230 install -p components/cli/build/docker $RPM_BUILD_ROOT%{_bindir}/docker
233 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
236 install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd
237 install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim
238 install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-ctr
241 install -p libnetwork/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
244 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
248 install -p bundles/latest/dynbinary-daemon/dockerd $RPM_BUILD_ROOT%{_sbindir}/dockerd
249 cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
250 cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
251 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
252 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
253 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
256 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
257 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
261 install -d $RPM_BUILD_ROOT%{_vimdatadir}
262 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
263 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
266 # bash and zsh completion
267 cd ../cli/contrib/completion
268 install -d $RPM_BUILD_ROOT%{bash_compdir}
269 cp -p bash/docker $RPM_BUILD_ROOT%{bash_compdir}
270 install -d $RPM_BUILD_ROOT%{zsh_compdir}
271 cp -p zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
274 %groupadd -g 296 docker
277 /sbin/chkconfig --add docker
278 %service -n docker restart
279 %systemd_post docker.service
282 if [ "$1" = "0" ]; then
283 %service -q docker stop
284 /sbin/chkconfig --del docker
286 %systemd_preun docker.service
289 if [ "$1" = "0" ]; then
294 %triggerun -- docker < 17.0
295 # Prevent preun from docker from working
296 chmod a-x /etc/rc.d/init.d/docker
298 %triggerpostun -- docker < 17.0
299 # Restore what triggerun removed
300 chmod 754 /etc/rc.d/init.d/docker
301 # reinstall docker init.d links, which could be different
302 /sbin/chkconfig --del docker
303 /sbin/chkconfig --add docker
306 rm -rf $RPM_BUILD_ROOT
309 %defattr(644,root,root,755)
310 %doc components/engine/{README.md,CHANGELOG.md,CONTRIBUTING.md,LICENSE,AUTHORS,NOTICE,MAINTAINERS}
311 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
312 %attr(754,root,root) /etc/rc.d/init.d/docker
313 %attr(755,root,root) %{_bindir}/docker
314 %attr(755,root,root) %{_sbindir}/docker-containerd
315 %attr(755,root,root) %{_sbindir}/docker-containerd-ctr
316 %attr(755,root,root) %{_sbindir}/docker-containerd-shim
317 %attr(755,root,root) %{_sbindir}/docker-init
318 %attr(755,root,root) %{_sbindir}/docker-proxy
319 %attr(755,root,root) %{_sbindir}/docker-runc
320 %attr(755,root,root) %{_sbindir}/dockerd
321 %attr(755,root,root) %{_libexecdir}/dockerd
322 %{systemdunitdir}/docker.service
323 %{systemdunitdir}/docker.socket
324 /lib/udev/rules.d/80-docker.rules
326 %dir %attr(700,root,root) /var/lib/docker
327 %dir %attr(700,root,root) /var/lib/docker/containers
328 %dir %attr(700,root,root) /var/lib/docker/execdriver
329 %dir %attr(700,root,root) /var/lib/docker/graph
330 %dir %attr(700,root,root) /var/lib/docker/image
331 %dir %attr(700,root,root) /var/lib/docker/init
332 %dir %attr(700,root,root) /var/lib/docker/network
333 %dir %attr(700,root,root) /var/lib/docker/swarm
334 %dir %attr(700,root,root) /var/lib/docker/tmp
335 %dir %attr(700,root,root) /var/lib/docker/trust
336 %dir %attr(700,root,root) /var/lib/docker/vfs
337 %dir %attr(700,root,root) /var/lib/docker/volumes
339 %files -n bash-completion-%{name}
340 %defattr(644,root,root,755)
341 %{bash_compdir}/docker
343 %files -n zsh-completion-%{name}
344 %defattr(644,root,root,755)
345 %{zsh_compdir}/_docker
348 %files -n vim-syntax-%{name}
349 %defattr(644,root,root,755)
350 %doc components/engine/contrib/syntax/vim/{README.md,LICENSE}
351 %{_vimdatadir}/doc/dockerfile.txt
352 %{_vimdatadir}/ftdetect/dockerfile.vim
353 %{_vimdatadir}/syntax/dockerfile.vim