]> git.pld-linux.org Git - packages/docker-ce.git/blob - docker-ce.spec
15009151400ac14c910438691cdee8e7d9e34ae2
[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-rc5
13 %define runc_commit 69663f0
14 # v1.1.1
15 %define containerd_commit d64c661
16 # v0.8.0-dev.2-1075-g1b91bc94
17 %define libnetwork_commit 3ac297b
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:        18.06.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:  ffe05742cecabed9536ad5ad84e18d38
31 Source1:        https://github.com/opencontainers/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
32 # Source1-md5:  980b5505478f3fe033dfe4922d7e0ea7
33 Source2:        https://github.com/containerd/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
34 # Source2-md5:  d06fa4307a8ef60efe86de98b0982287
35 Source3:        https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
36 # Source3-md5:  f7e0a1a39a87252a2e1a1ad8f8fb5c66
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.10
48 BuildRequires:  libseccomp-devel >= 2.3
49 BuildRequires:  rpmbuild(macros) >= 1.644
50 BuildRequires:  sqlite3-devel >= 3.7.9
51 BuildRequires:  xxd
52 Requires(post,preun):   /sbin/chkconfig
53 Requires(postun):       /usr/sbin/groupdel
54 Requires(pre):  /usr/bin/getgid
55 Requires(pre):  /usr/sbin/groupadd
56 Requires:       ca-certificates
57 Requires:       iproute2 >= 3.5
58 Requires:       iptables
59 Requires:       rc-scripts >= 0.4.0.10
60 Requires:       systemd-units >= 38
61 Requires:       tar >= 1:1.26
62 Requires:       uname(release) >= 3.8
63 Requires:       xz
64 Suggests:       docker-credential-helpers
65 Suggests:       git-core >= 1.7
66 Suggests:       libcgroup
67 Suggests:       xz >= 1:4.9
68 Provides:       docker = %{version}
69 Provides:       docker(engine) = %{version}
70 Provides:       group(docker)
71 Requires:       libseccomp >= 2.3
72 Obsoletes:      docker < 18.0
73 Obsoletes:      lxc-docker < 1.1.1
74 # only runs on x64 hosts for now:
75 # https://github.com/docker/docker/issues/136
76 # https://github.com/docker/docker/issues/611
77 ExclusiveArch:  %{x8664}
78 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79
80 %define         bash_compdir    %{_datadir}/bash-completion/completions
81 %define         zsh_compdir     %{_datadir}/zsh/site-functions
82 %define         _vimdatadir             %{_datadir}/vim
83 %define         _libexecdir             %{_prefix}/lib
84
85 # binary stripped or something
86 %define         _enable_debug_packages 0
87
88 %description
89 Docker is an open source project to pack, ship and run any application
90 as a lightweight container
91
92 Docker containers are both hardware-agnostic and platform-agnostic.
93 This means that they can run anywhere, from your laptop to the largest
94 EC2 compute instance and everything in between - and they don't
95 require that you use a particular language, framework or packaging
96 system. That makes them great building blocks for deploying and
97 scaling web apps, databases and backend services without depending on
98 a particular stack or provider.
99
100 Docker is an open-source implementation of the deployment engine which
101 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
102 from the experience accumulated over several years of large-scale
103 operation and support of hundreds of thousands of applications and
104 databases.
105
106 %package -n bash-completion-%{name}
107 Summary:        bash-completion for Docker
108 Summary(pl.UTF-8):      bashowe uzupełnianie nazw dla Dockera
109 Group:          Applications/Shells
110 Requires:       %{name}
111 Requires:       bash-completion >= 2.0
112 Obsoletes:      bash-completion-lxc-docker < 1.1.1
113 %if "%{_rpmversion}" >= "5"
114 BuildArch:      noarch
115 %endif
116
117 %description -n bash-completion-%{name}
118 This package provides bash-completion for Docker.
119
120 %description -n bash-completion-%{name} -l pl.UTF-8
121 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
122
123 %package -n zsh-completion-%{name}
124 Summary:        zsh completion for Docker
125 Summary(pl.UTF-8):      Uzupełnianie parametrów w zsh dla poleceń Dockera
126 Group:          Applications/Shells
127 Requires:       %{name}
128 %if "%{_rpmversion}" >= "5"
129 BuildArch:      noarch
130 %endif
131
132 %description -n zsh-completion-%{name}
133 This package provides zsh completion for Docker.
134
135 %description -n zsh-completion-%{name} -l pl.UTF-8
136 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
137
138 %package -n vim-syntax-%{name}
139 Summary:        Vim syntax: Docker
140 Group:          Applications/Editors/Vim
141 Requires:       %{name} = %{version}-%{release}
142 Requires:       vim-rt >= 4:7.2.170
143 Obsoletes:      vim-syntax-lxc-docker < 1.1.1
144 %if "%{_rpmversion}" >= "5"
145 BuildArch:      noarch
146 %endif
147
148 %description -n vim-syntax-%{name}
149 This plugin provides syntax highlighting in Dockerfile.
150
151 %prep
152 %setup -q -n %{name}-%{version}-ce%{?subver} -a1 -a2 -a3 -a4
153
154 mv runc-%{runc_commit}* runc
155 mv runc/vendor runc/src
156 ln -s ../../.. runc/src/github.com/opencontainers/runc
157
158 mv containerd-%{containerd_commit}* containerd
159 mv containerd/vendor containerd/src
160 ln -s ../../.. containerd/src/github.com/containerd/containerd
161
162 mv libnetwork-%{libnetwork_commit}* libnetwork
163 install -d libnetwork/gopath
164 mv libnetwork/vendor libnetwork/gopath/src
165 ln -s ../../../.. libnetwork/gopath/src/github.com/docker/libnetwork
166
167 mv tini-* tini
168
169 install -d components/cli/.gopath/src/github.com/docker
170 ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
171
172 %patch0 -p1 -d components/engine
173
174 %build
175 grep -rhE "=%{runc_commit}|=%{containerd_commit}|=%{libnetwork_commit}" $(pwd)/components/engine/hack/dockerfile/install/
176
177 export VERSION=%{version}
178 export GITCOMMIT="PLD-Linux/%{version}" # for cli
179 export DOCKER_GITCOMMIT="PLD-Linux/%{version}" # for engine
180
181 # build docker-runc
182 sed -i -e 's,shell git,shell false,' runc/Makefile
183 GOPATH=$(pwd)/runc \
184 %{__make} -C runc \
185         COMMIT=$RUNC_COMMIT
186 ./runc/runc -v
187
188 # build docker-containerd
189 GOPATH=$(pwd)/containerd \
190 %{__make} -C containerd \
191         GIT_COMMIT=$CONTAINERD_COMMIT
192
193 # build docker-proxy
194 cd libnetwork
195 GOPATH=$(pwd)/gopath \
196 go build -ldflags="-linkmode=external" \
197         -o docker-proxy \
198         github.com/docker/libnetwork/cmd/proxy
199 cd ..
200
201 # build docker-init
202 cd tini
203 cmake .
204 %{__make}
205
206 # docker cli
207 cd ../components/cli
208 GOPATH=$(pwd)/.gopath \
209 DISABLE_WARN_OUTSIDE_CONTAINER=1 \
210 %{__make} dynbinary
211 ./build/docker -v
212
213 cd ../engine
214 AUTO_GOPATH=1 \
215 bash -x hack/make.sh dynbinary
216 ./bundles/latest/dynbinary-daemon/dockerd -v
217 %if %{with doc}
218 man/md2man-all.sh
219 %endif
220
221 %install
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}
226
227 # docker-cli
228 install -p components/cli/build/docker $RPM_BUILD_ROOT%{_bindir}/docker
229
230 # docker-runc
231 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
232
233 # docker-containerd
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
237
238 # docker-proxy
239 install -p libnetwork/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
240
241 # docker-init
242 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
243
244 # dockerd
245 cd components/engine
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
252
253 # install udev rules
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
256
257 # vim syntax
258 %if %{with vim}
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}
262 %endif
263
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}
270
271 %pre
272 %groupadd -g 296 docker
273
274 %post
275 /sbin/chkconfig --add docker
276 %service -n docker restart
277 %systemd_post docker.service
278
279 %preun
280 if [ "$1" = "0" ]; then
281         %service -q docker stop
282         /sbin/chkconfig --del docker
283 fi
284 %systemd_preun docker.service
285
286 %postun
287 if [ "$1" = "0" ]; then
288         %groupremove docker
289 fi
290 %systemd_reload
291
292 %triggerun -- docker < 17.0
293 # Prevent preun from docker from working
294 chmod a-x /etc/rc.d/init.d/docker
295
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
302
303 %clean
304 rm -rf $RPM_BUILD_ROOT
305
306 %files
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
323
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
336
337 %files -n bash-completion-%{name}
338 %defattr(644,root,root,755)
339 %{bash_compdir}/docker
340
341 %files -n zsh-completion-%{name}
342 %defattr(644,root,root,755)
343 %{zsh_compdir}/_docker
344
345 %if %{with vim}
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
352 %endif
This page took 0.101076 seconds and 2 git commands to generate.