]> git.pld-linux.org Git - packages/docker-ce.git/blob - docker-ce.spec
up to 17.09.0-ce
[packages/docker-ce.git] / docker-ce.spec
1 #
2 # Conditional build:
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
6
7 # TODO: drop P docker when docker-compose updated to use docker(engine) dep
8
9 # NOTES
10 # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
11
12 # v1.0.0-rc2-528-g3f2f8b84
13 %define runc_commit 3f2f8b8
14 # v0.2.9-27-g06b9cb35
15 %define containerd_commit 06b9cb3
16 # v0.8.0-dev.2-624-g7b2b1feb
17 %define libnetwork_commit 7b2b1fe
18 #define subver -rc2
19 Summary:        Docker CE: the open-source application container engine
20 Name:           docker-ce
21 # Using Docker-CE, Stay on Stable channel
22 # https://docs.docker.com/engine/installation/
23 Version:        17.09.0
24 Release:        1
25 License:        Apache v2.0
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
39 Source5:        dockerd.sh
40 Source7:        docker.init
41 Source8:        docker.sysconfig
42 Patch0:         systemd.patch
43 URL:            https://www.docker.com/community-edition/
44 BuildRequires:  btrfs-progs-devel >= 3.16.1
45 BuildRequires:  cmake
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
57 Requires:       iptables
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
62 Requires:       xz
63 Suggests:       docker-credential-helpers
64 Suggests:       git-core >= 1.7
65 Suggests:       libcgroup
66 Suggests:       xz >= 1:4.9
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)
77
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
82
83 # binary stripped or something
84 %define         _enable_debug_packages 0
85
86 %description
87 Docker is an open source project to pack, ship and run any application
88 as a lightweight container
89
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.
97
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
102 databases.
103
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
108 Requires:       %{name}
109 Requires:       bash-completion >= 2.0
110 Obsoletes:      bash-completion-lxc-docker < 1.1.1
111 %if "%{_rpmversion}" >= "5"
112 BuildArch:      noarch
113 %endif
114
115 %description -n bash-completion-%{name}
116 This package provides bash-completion for Docker.
117
118 %description -n bash-completion-%{name} -l pl.UTF-8
119 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
120
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
125 Requires:       %{name}
126 %if "%{_rpmversion}" >= "5"
127 BuildArch:      noarch
128 %endif
129
130 %description -n zsh-completion-%{name}
131 This package provides zsh completion for Docker.
132
133 %description -n zsh-completion-%{name} -l pl.UTF-8
134 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
135
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"
143 BuildArch:      noarch
144 %endif
145
146 %description -n vim-syntax-%{name}
147 This plugin provides syntax highlighting in Dockerfile.
148
149 %prep
150 %setup -q -n %{name}-%{version}-ce%{?subver} -a1 -a2 -a3 -a4
151
152 mv runc-%{runc_commit}* runc
153 mv runc/vendor runc/src
154 ln -s ../../.. runc/src/github.com/opencontainers/runc
155
156 mv containerd-%{containerd_commit}* containerd
157 mv containerd/vendor containerd/src
158 ln -s ../../.. containerd/src/github.com/containerd/containerd
159
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
164
165 mv tini-* tini
166
167 install -d components/cli/.gopath/src/github.com/docker
168 ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
169
170 %patch0 -p1 -d components/engine
171
172 %build
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}"
180
181 export VERSION=%{version}
182 export GITCOMMIT="pld/%{version}" # for cli
183 export DOCKER_GITCOMMIT="pld/%{version}" # for engine
184
185 # build docker-runc
186 sed -i -e 's,shell git,shell false,' runc/Makefile
187 GOPATH=$(pwd)/runc \
188 %{__make} -C runc \
189         COMMIT=%{runc_commit}
190 ./runc/runc -v
191
192 # build docker-containerd
193 GOPATH=$(pwd)/containerd \
194 %{__make} -C containerd
195
196 # build docker-proxy
197 cd libnetwork
198 GOPATH=$(pwd)/gopath \
199 go build -ldflags="-linkmode=external" \
200         -o docker-proxy \
201         github.com/docker/libnetwork/cmd/proxy
202 cd ..
203
204 # build docker-init
205 cd tini
206 cmake .
207 %{__make}
208
209 # docker cli
210 cd ../components/cli
211 GOPATH=$(pwd)/.gopath \
212 %{__make} dynbinary
213 ./build/docker -v
214
215 cd ../engine
216 AUTO_GOPATH=1 \
217 bash -x hack/make.sh dynbinary
218 ./bundles/latest/dynbinary-daemon/dockerd -v
219 %if %{with doc}
220 man/md2man-all.sh
221 %endif
222
223 %install
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}
228
229 # docker-cli
230 install -p components/cli/build/docker $RPM_BUILD_ROOT%{_bindir}/docker
231
232 # docker-runc
233 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
234
235 # docker-containerd
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
239
240 # docker-proxy
241 install -p libnetwork/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
242
243 # docker-init
244 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
245
246 # dockerd
247 cd components/engine
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
254
255 # install udev rules
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
258
259 # vim syntax
260 %if %{with vim}
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}
264 %endif
265
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}
272
273 %pre
274 %groupadd -g 296 docker
275
276 %post
277 /sbin/chkconfig --add docker
278 %service -n docker restart
279 %systemd_post docker.service
280
281 %preun
282 if [ "$1" = "0" ]; then
283         %service -q docker stop
284         /sbin/chkconfig --del docker
285 fi
286 %systemd_preun docker.service
287
288 %postun
289 if [ "$1" = "0" ]; then
290         %groupremove docker
291 fi
292 %systemd_reload
293
294 %triggerun -- docker < 17.0
295 # Prevent preun from docker from working
296 chmod a-x /etc/rc.d/init.d/docker
297
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
304
305 %clean
306 rm -rf $RPM_BUILD_ROOT
307
308 %files
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
325
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
338
339 %files -n bash-completion-%{name}
340 %defattr(644,root,root,755)
341 %{bash_compdir}/docker
342
343 %files -n zsh-completion-%{name}
344 %defattr(644,root,root,755)
345 %{zsh_compdir}/_docker
346
347 %if %{with vim}
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
354 %endif
This page took 0.051198 seconds and 3 git commands to generate.