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-394-g810190ce
13 %define runc_commit 810190c
15 %define containerd_commit 6e23458
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/%{name}-%{version}-ce.tar.gz
29 # Source0-md5: a0d638496215364a7eec4d280dba62f1
30 Source1: https://github.com/docker/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
31 # Source1-md5: d2d5d628662bfbe11fd0d1bb7eb1c63c
32 Source2: https://github.com/docker/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
33 # Source2-md5: d1d057d831d46021cefee3a3c52c6c65
34 Source3: https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
35 # Source3-md5: 9360e38c43e862e42c128db1852ac5bb
36 Source4: https://github.com/krallin/tini/archive/v0.13.0/tini-0.13.0.tar.gz
37 # Source4-md5: c29541112a242c53c82bb6b1213f288f
40 Source8: docker.sysconfig
42 URL: https://www.docker.com/community-edition/
43 BuildRequires: btrfs-progs-devel >= 3.16.1
45 BuildRequires: device-mapper-devel >= 2.02.89
46 BuildRequires: golang >= 1.6
47 BuildRequires: libseccomp-devel >= 2.2.1
48 BuildRequires: rpmbuild(macros) >= 1.644
49 BuildRequires: sqlite3-devel >= 3.7.9
50 Requires(post,preun): /sbin/chkconfig
51 Requires(postun): /usr/sbin/groupdel
52 Requires(pre): /usr/bin/getgid
53 Requires(pre): /usr/sbin/groupadd
54 Requires: ca-certificates
55 Requires: iproute2 >= 3.5
57 Requires: rc-scripts >= 0.4.0.10
58 Requires: systemd-units >= 38
59 Requires: tar >= 1:1.26
60 Requires: uname(release) >= 3.8
62 Suggests: docker-credential-helpers
63 Suggests: git-core >= 1.7
66 Provides: docker = %{version}
67 Provides: docker(engine) = %{version}
68 Provides: group(docker)
69 Obsoletes: docker < 17.0
70 Obsoletes: lxc-docker < 1.1.1
71 # only runs on x64 hosts for now:
72 # https://github.com/docker/docker/issues/136
73 # https://github.com/docker/docker/issues/611
74 ExclusiveArch: %{x8664}
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77 %define bash_compdir %{_datadir}/bash-completion/completions
78 %define zsh_compdir %{_datadir}/zsh/site-functions
79 %define _vimdatadir %{_datadir}/vim
80 %define _libexecdir %{_prefix}/lib
82 # binary stripped or something
83 %define _enable_debug_packages 0
86 Docker is an open source project to pack, ship and run any application
87 as a lightweight container
89 Docker containers are both hardware-agnostic and platform-agnostic.
90 This means that they can run anywhere, from your laptop to the largest
91 EC2 compute instance and everything in between - and they don't
92 require that you use a particular language, framework or packaging
93 system. That makes them great building blocks for deploying and
94 scaling web apps, databases and backend services without depending on
95 a particular stack or provider.
97 Docker is an open-source implementation of the deployment engine which
98 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
99 from the experience accumulated over several years of large-scale
100 operation and support of hundreds of thousands of applications and
103 %package -n bash-completion-%{name}
104 Summary: bash-completion for Docker
105 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
106 Group: Applications/Shells
108 Requires: bash-completion >= 2.0
109 Obsoletes: bash-completion-lxc-docker < 1.1.1
110 %if "%{_rpmversion}" >= "5"
114 %description -n bash-completion-%{name}
115 This package provides bash-completion for Docker.
117 %description -n bash-completion-%{name} -l pl.UTF-8
118 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
120 %package -n zsh-completion-%{name}
121 Summary: zsh completion for Docker
122 Summary(pl.UTF-8): Uzupełnianie parametrów w zsh dla poleceń Dockera
123 Group: Applications/Shells
125 %if "%{_rpmversion}" >= "5"
129 %description -n zsh-completion-%{name}
130 This package provides zsh completion for Docker.
132 %description -n zsh-completion-%{name} -l pl.UTF-8
133 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
135 %package -n vim-syntax-%{name}
136 Summary: Vim syntax: Docker
137 Group: Applications/Editors/Vim
138 Requires: %{name} = %{version}-%{release}
139 Requires: vim-rt >= 4:7.2.170
140 Obsoletes: vim-syntax-lxc-docker < 1.1.1
141 %if "%{_rpmversion}" >= "5"
145 %description -n vim-syntax-%{name}
146 This plugin provides syntax highlighting in Dockerfile.
149 %setup -q -n docker-ce-%{version}-ce%{?subver} -a1 -a2 -a3 -a4
151 mv runc-%{runc_commit}* runc
152 mv runc/vendor runc/src
153 ln -s ../../.. runc/src/github.com/opencontainers/runc
155 mv containerd-%{containerd_commit}* containerd
156 ln -s ../../../.. containerd/vendor/src/github.com/containerd/containerd
158 mv libnetwork-%{libnetwork_commit}* libnetwork
159 install -d libnetwork/gopath
160 mv libnetwork/vendor libnetwork/gopath/src
161 ln -s ../../../.. libnetwork/gopath/src/github.com/docker/libnetwork
165 install -d components/cli/.gopath/src/github.com/docker
166 ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
168 %patch0 -p1 -d components/engine
171 f=components/engine/hack/dockerfile/binaries-commits
172 v=$(awk -F= '/^RUNC_COMMIT/ {print $2}' $f)
173 echo "$v" | grep "^%{runc_commit}"
174 v=$(awk -F= '/^CONTAINERD_COMMIT/ {print $2}' $f)
175 echo "$v" | grep "^%{containerd_commit}"
176 v=$(awk -F= '/^LIBNETWORK_COMMIT/ {print $2}' $f)
177 echo "$v" | grep "^%{libnetwork_commit}"
179 export VERSION=%{version}
180 export GITCOMMIT="pld/%{version}" # for cli
181 export DOCKER_GITCOMMIT="pld/%{version}" # for engine
184 sed -i -e 's,shell git,shell false,' runc/Makefile
187 COMMIT=%{runc_commit}
190 # build docker-containerd
191 GOPATH=$(pwd)/containerd/vendor \
192 %{__make} -C containerd
196 GOPATH=$(pwd)/gopath \
197 go build -ldflags="-linkmode=external" \
199 github.com/docker/libnetwork/cmd/proxy
209 GOPATH=$(pwd)/.gopath \
215 bash -x hack/make.sh dynbinary
216 ./bundles/latest/dynbinary-daemon/dockerd -v
222 rm -rf $RPM_BUILD_ROOT
223 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
224 $RPM_BUILD_ROOT%{_libexecdir} \
225 $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
228 install -p components/cli/build/docker $RPM_BUILD_ROOT%{_bindir}/docker
231 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
234 install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd
235 install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim
236 install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-ctr
239 install -p libnetwork/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
242 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
246 install -p bundles/latest/dynbinary-daemon/dockerd $RPM_BUILD_ROOT%{_sbindir}/dockerd
247 cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
248 cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
249 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
250 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
251 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
254 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
255 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
259 install -d $RPM_BUILD_ROOT%{_vimdatadir}
260 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
261 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
264 # bash and zsh completion
265 cd ../cli/contrib/completion
266 install -d $RPM_BUILD_ROOT%{bash_compdir}
267 cp -p bash/docker $RPM_BUILD_ROOT%{bash_compdir}
268 install -d $RPM_BUILD_ROOT%{zsh_compdir}
269 cp -p zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
272 %groupadd -g 296 docker
275 /sbin/chkconfig --add docker
276 %service -n docker restart
277 %systemd_post docker.service
280 if [ "$1" = "0" ]; then
281 %service -q docker stop
282 /sbin/chkconfig --del docker
284 %systemd_preun docker.service
287 if [ "$1" = "0" ]; then
292 %triggerun -- docker < 17.0
293 # Prevent preun from docker from working
294 chmod a-x /etc/rc.d/init.d/docker
296 %triggerpostun -- docker < 17.0
297 # Restore what triggerun removed
298 chmod 754 /etc/rc.d/init.d/docker
299 # reinstall docker init.d links, which could be different
300 /sbin/chkconfig --del docker
301 /sbin/chkconfig --add docker
304 rm -rf $RPM_BUILD_ROOT
307 %defattr(644,root,root,755)
308 %doc components/engine/{README.md,CHANGELOG.md,CONTRIBUTING.md,LICENSE,AUTHORS,NOTICE,MAINTAINERS}
309 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
310 %attr(754,root,root) /etc/rc.d/init.d/docker
311 %attr(755,root,root) %{_bindir}/docker
312 %attr(755,root,root) %{_sbindir}/docker-containerd
313 %attr(755,root,root) %{_sbindir}/docker-containerd-ctr
314 %attr(755,root,root) %{_sbindir}/docker-containerd-shim
315 %attr(755,root,root) %{_sbindir}/docker-init
316 %attr(755,root,root) %{_sbindir}/docker-proxy
317 %attr(755,root,root) %{_sbindir}/docker-runc
318 %attr(755,root,root) %{_sbindir}/dockerd
319 %attr(755,root,root) %{_libexecdir}/dockerd
320 %{systemdunitdir}/docker.service
321 %{systemdunitdir}/docker.socket
322 /lib/udev/rules.d/80-docker.rules
324 %dir %attr(700,root,root) /var/lib/docker
325 %dir %attr(700,root,root) /var/lib/docker/containers
326 %dir %attr(700,root,root) /var/lib/docker/execdriver
327 %dir %attr(700,root,root) /var/lib/docker/graph
328 %dir %attr(700,root,root) /var/lib/docker/image
329 %dir %attr(700,root,root) /var/lib/docker/init
330 %dir %attr(700,root,root) /var/lib/docker/network
331 %dir %attr(700,root,root) /var/lib/docker/swarm
332 %dir %attr(700,root,root) /var/lib/docker/tmp
333 %dir %attr(700,root,root) /var/lib/docker/trust
334 %dir %attr(700,root,root) /var/lib/docker/vfs
335 %dir %attr(700,root,root) /var/lib/docker/volumes
337 %files -n bash-completion-%{name}
338 %defattr(644,root,root,755)
339 %{bash_compdir}/docker
341 %files -n zsh-completion-%{name}
342 %defattr(644,root,root,755)
343 %{zsh_compdir}/_docker
346 %files -n vim-syntax-%{name}
347 %defattr(644,root,root,755)
348 %doc components/engine/contrib/syntax/vim/{README.md,LICENSE}
349 %{_vimdatadir}/doc/dockerfile.txt
350 %{_vimdatadir}/ftdetect/dockerfile.vim
351 %{_vimdatadir}/syntax/dockerfile.vim