]> git.pld-linux.org Git - packages/docker-ce.git/blob - docker-ce.spec
up to 18.09.4
[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-ce/releases
11 # - https://github.com/moby/moby/blob/master/project/PACKAGERS.md#build-dependencies
12
13 # v1.0.0-rc6
14 %define runc_commit 2b18fe1
15 # v1.2.5
16 %define containerd_commit bb71b10
17 # v0.8.0-dev.2-1075-g1b91bc94
18 %define libnetwork_commit 4725f21
19 #define subver -rc2
20 Summary:        Docker CE: the open-source application container engine
21 Name:           docker-ce
22 # Using Docker-CE, Stay on Stable channel
23 # https://docs.docker.com/engine/installation/
24 Version:        18.09.4
25 Release:        1
26 License:        Apache v2.0
27 Group:          Applications/System
28 # https://github.com/docker/docker-ce/releases
29 #Source0:       https://github.com/docker/docker-ce/archive/v%{version}-ce%{subver}/%{name}-%{version}-ce%{subver}.tar.gz
30 Source0:        https://github.com/docker/docker-ce/archive/v%{version}/%{name}-%{version}.tar.gz
31 # Source0-md5:  d931008eec55afedd9862854a6bf4d25
32 Source1:        https://github.com/opencontainers/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
33 # Source1-md5:  203f2297b644c356278a3567a5494352
34 Source2:        https://github.com/containerd/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
35 # Source2-md5:  06c979a4703baa51edcd693bccb61395
36 Source3:        https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
37 # Source3-md5:  ee0746cbb7a3e69899c08f8cb297a0ae
38 Source4:        https://github.com/krallin/tini/archive/v0.18.0/tini-0.18.0.tar.gz
39 # Source4-md5:  cc3b205a1b83b8e6ed6892fc5e8ef2c3
40 Source5:        dockerd.sh
41 Source7:        docker.init
42 Source8:        docker.sysconfig
43 Patch0:         systemd.patch
44 URL:            https://www.docker.com/community-edition/
45 BuildRequires:  btrfs-progs-devel >= 3.16.1
46 BuildRequires:  cmake
47 BuildRequires:  device-mapper-devel >= 2.02.89
48 BuildRequires:  golang >= 1.10
49 BuildRequires:  libseccomp-devel >= 2.3
50 BuildRequires:  rpmbuild(macros) >= 1.644
51 BuildRequires:  sqlite3-devel >= 3.7.9
52 BuildRequires:  xxd
53 Requires(post,preun):   /sbin/chkconfig
54 Requires(postun):       /usr/sbin/groupdel
55 Requires(pre):  /usr/bin/getgid
56 Requires(pre):  /usr/sbin/groupadd
57 Requires:       ca-certificates
58 Requires:       iproute2 >= 3.5
59 Requires:       iptables
60 Requires:       rc-scripts >= 0.4.0.10
61 Requires:       systemd-units >= 38
62 Requires:       tar >= 1:1.26
63 Requires:       uname(release) >= 3.8
64 Requires:       xz
65 Suggests:       docker-credential-helpers
66 Suggests:       git-core >= 1.7
67 Suggests:       libcgroup
68 Suggests:       xz >= 1:4.9
69 Provides:       docker = %{version}
70 Provides:       docker(engine) = %{version}
71 Provides:       group(docker)
72 Requires:       libseccomp >= 2.3
73 Obsoletes:      docker < 18.0
74 Obsoletes:      lxc-docker < 1.1.1
75 # only runs on x64 hosts for now:
76 # https://github.com/docker/docker/issues/136
77 # https://github.com/docker/docker/issues/611
78 ExclusiveArch:  %{x8664}
79 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
81 %define         bash_compdir    %{_datadir}/bash-completion/completions
82 %define         zsh_compdir     %{_datadir}/zsh/site-functions
83 %define         _vimdatadir             %{_datadir}/vim
84 %define         _libexecdir             %{_prefix}/lib
85
86 # binary stripped or something
87 %define         _enable_debug_packages 0
88
89 %description
90 Docker is an open source project to pack, ship and run any application
91 as a lightweight container
92
93 Docker containers are both hardware-agnostic and platform-agnostic.
94 This means that they can run anywhere, from your laptop to the largest
95 EC2 compute instance and everything in between - and they don't
96 require that you use a particular language, framework or packaging
97 system. That makes them great building blocks for deploying and
98 scaling web apps, databases and backend services without depending on
99 a particular stack or provider.
100
101 Docker is an open-source implementation of the deployment engine which
102 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
103 from the experience accumulated over several years of large-scale
104 operation and support of hundreds of thousands of applications and
105 databases.
106
107 %package -n bash-completion-%{name}
108 Summary:        bash-completion for Docker
109 Summary(pl.UTF-8):      bashowe uzupełnianie nazw dla Dockera
110 Group:          Applications/Shells
111 Requires:       %{name}
112 Requires:       bash-completion >= 2.0
113 Obsoletes:      bash-completion-lxc-docker < 1.1.1
114 %if "%{_rpmversion}" >= "5"
115 BuildArch:      noarch
116 %endif
117
118 %description -n bash-completion-%{name}
119 This package provides bash-completion for Docker.
120
121 %description -n bash-completion-%{name} -l pl.UTF-8
122 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
123
124 %package -n zsh-completion-%{name}
125 Summary:        zsh completion for Docker
126 Summary(pl.UTF-8):      Uzupełnianie parametrów w zsh dla poleceń Dockera
127 Group:          Applications/Shells
128 Requires:       %{name}
129 %if "%{_rpmversion}" >= "5"
130 BuildArch:      noarch
131 %endif
132
133 %description -n zsh-completion-%{name}
134 This package provides zsh completion for Docker.
135
136 %description -n zsh-completion-%{name} -l pl.UTF-8
137 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
138
139 %package -n vim-syntax-%{name}
140 Summary:        Vim syntax: Docker
141 Group:          Applications/Editors/Vim
142 Requires:       %{name} = %{version}-%{release}
143 Requires:       vim-rt >= 4:7.2.170
144 Obsoletes:      vim-syntax-lxc-docker < 1.1.1
145 %if "%{_rpmversion}" >= "5"
146 BuildArch:      noarch
147 %endif
148
149 %description -n vim-syntax-%{name}
150 This plugin provides syntax highlighting in Dockerfile.
151
152 %prep
153 %setup -q -n %{name}-%{version}%{?subver} -a1 -a2 -a3 -a4
154
155 mv runc-%{runc_commit}* runc
156 mv runc/vendor runc/src
157 ln -s ../../.. runc/src/github.com/opencontainers/runc
158
159 mv containerd-%{containerd_commit}* containerd
160 mv containerd/vendor containerd/src
161 ln -s ../../.. containerd/src/github.com/containerd/containerd
162
163 mv libnetwork-%{libnetwork_commit}* libnetwork
164 install -d libnetwork/gopath
165 mv libnetwork/vendor libnetwork/gopath/src
166 ln -s ../../../.. libnetwork/gopath/src/github.com/docker/libnetwork
167
168 mv tini-* tini
169
170 install -d components/cli/.gopath/src/github.com/docker
171 ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
172
173 %patch0 -p1 -d components/engine
174
175 %build
176 grep -rhE "=%{runc_commit}|=%{containerd_commit}|=%{libnetwork_commit}" $(pwd)/components/engine/hack/dockerfile/install/
177
178 export VERSION=%{version}-ce # for `docker version`
179 export GITCOMMIT="PLD-Linux/%{version}" # for cli
180 export DOCKER_GITCOMMIT="PLD-Linux/%{version}" # for engine
181
182 # build runc
183 sed -i -e 's,shell git,shell false,' runc/Makefile
184 GOPATH=$(pwd)/runc \
185 %{__make} -C runc \
186         COMMIT=$RUNC_COMMIT
187 ./runc/runc -v
188
189 # build containerd
190 GOPATH=$(pwd)/containerd \
191 %{__make} -C containerd \
192         GIT_COMMIT=$CONTAINERD_COMMIT
193
194 # build docker-proxy
195 cd libnetwork
196 GOPATH=$(pwd)/gopath \
197 go build -ldflags="-linkmode=external" \
198         -o docker-proxy \
199         github.com/docker/libnetwork/cmd/proxy
200 cd ..
201
202 # build docker-init
203 cd tini
204 cmake .
205 %{__make}
206
207 # docker cli
208 cd ../components/cli
209 GOPATH=$(pwd)/.gopath \
210 DISABLE_WARN_OUTSIDE_CONTAINER=1 \
211 %{__make} dynbinary
212 ./build/docker -v
213
214 cd ../engine
215 AUTO_GOPATH=1 \
216 bash -x hack/make.sh dynbinary
217 ./bundles/latest/dynbinary-daemon/dockerd -v
218 %if %{with doc}
219 man/md2man-all.sh
220 %endif
221
222 %install
223 rm -rf $RPM_BUILD_ROOT
224 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
225         $RPM_BUILD_ROOT%{_libexecdir} \
226         $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
227
228 # docker-cli
229 install -p components/cli/build/docker $RPM_BUILD_ROOT%{_bindir}/docker
230
231 # runc
232 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/runc
233
234 # containerd
235 install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/containerd
236 install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/containerd-shim
237 install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/ctr
238
239 # docker-proxy
240 install -p libnetwork/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
241
242 # docker-init
243 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
244
245 # dockerd
246 cd components/engine
247 install -p bundles/latest/dynbinary-daemon/dockerd $RPM_BUILD_ROOT%{_sbindir}/dockerd
248 cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
249 cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
250 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
251 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
252 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
253
254 # install udev rules
255 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
256 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
257
258 # vim syntax
259 %if %{with vim}
260 install -d $RPM_BUILD_ROOT%{_vimdatadir}
261 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
262 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
263 %endif
264
265 # bash and zsh completion
266 cd ../cli/contrib/completion
267 install -d $RPM_BUILD_ROOT%{bash_compdir}
268 cp -p bash/docker $RPM_BUILD_ROOT%{bash_compdir}
269 install -d $RPM_BUILD_ROOT%{zsh_compdir}
270 cp -p zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
271
272 %pre
273 %groupadd -g 296 docker
274
275 %post
276 /sbin/chkconfig --add docker
277 %service -n docker restart
278 %systemd_post docker.service
279
280 %preun
281 if [ "$1" = "0" ]; then
282         %service -q docker stop
283         /sbin/chkconfig --del docker
284 fi
285 %systemd_preun docker.service
286
287 %postun
288 if [ "$1" = "0" ]; then
289         %groupremove docker
290 fi
291 %systemd_reload
292
293 %triggerun -- docker < 17.0
294 # Prevent preun from docker from working
295 chmod a-x /etc/rc.d/init.d/docker
296
297 %triggerpostun -- docker < 17.0
298 # Restore what triggerun removed
299 chmod 754 /etc/rc.d/init.d/docker
300 # reinstall docker init.d links, which could be different
301 /sbin/chkconfig --del docker
302 /sbin/chkconfig --add docker
303
304 %clean
305 rm -rf $RPM_BUILD_ROOT
306
307 %files
308 %defattr(644,root,root,755)
309 %doc components/engine/{README.md,CHANGELOG.md,CONTRIBUTING.md,LICENSE,AUTHORS,NOTICE,MAINTAINERS}
310 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
311 %attr(754,root,root) /etc/rc.d/init.d/docker
312 %attr(755,root,root) %{_bindir}/docker
313 %attr(755,root,root) %{_sbindir}/containerd
314 %attr(755,root,root) %{_sbindir}/ctr
315 %attr(755,root,root) %{_sbindir}/containerd-shim
316 %attr(755,root,root) %{_sbindir}/docker-init
317 %attr(755,root,root) %{_sbindir}/docker-proxy
318 %attr(755,root,root) %{_sbindir}/runc
319 %attr(755,root,root) %{_sbindir}/dockerd
320 %attr(755,root,root) %{_libexecdir}/dockerd
321 %{systemdunitdir}/docker.service
322 %{systemdunitdir}/docker.socket
323 /lib/udev/rules.d/80-docker.rules
324
325 %dir %attr(700,root,root) /var/lib/docker
326 %dir %attr(700,root,root) /var/lib/docker/containers
327 %dir %attr(700,root,root) /var/lib/docker/execdriver
328 %dir %attr(700,root,root) /var/lib/docker/graph
329 %dir %attr(700,root,root) /var/lib/docker/image
330 %dir %attr(700,root,root) /var/lib/docker/init
331 %dir %attr(700,root,root) /var/lib/docker/network
332 %dir %attr(700,root,root) /var/lib/docker/swarm
333 %dir %attr(700,root,root) /var/lib/docker/tmp
334 %dir %attr(700,root,root) /var/lib/docker/trust
335 %dir %attr(700,root,root) /var/lib/docker/vfs
336 %dir %attr(700,root,root) /var/lib/docker/volumes
337
338 %files -n bash-completion-%{name}
339 %defattr(644,root,root,755)
340 %{bash_compdir}/docker
341
342 %files -n zsh-completion-%{name}
343 %defattr(644,root,root,755)
344 %{zsh_compdir}/_docker
345
346 %if %{with vim}
347 %files -n vim-syntax-%{name}
348 %defattr(644,root,root,755)
349 %doc components/engine/contrib/syntax/vim/{README.md,LICENSE}
350 %{_vimdatadir}/doc/dockerfile.txt
351 %{_vimdatadir}/ftdetect/dockerfile.vim
352 %{_vimdatadir}/syntax/dockerfile.vim
353 %endif
This page took 0.065683 seconds and 3 git commands to generate.