]> git.pld-linux.org Git - packages/docker-ce.git/blob - docker-ce.spec
disable go mod, rediff patch and rebuild with current go runtime; rel 2
[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-rc10
14 %define runc_commit dc9208a
15 # v1.3.9
16 %define containerd_commit ea765ab
17 # v0.8.0-dev.2-1075-g1b91bc94
18 %define libnetwork_commit 55e924b
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:        19.03.14
25 Release:        2
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:  f932ff952a0411223a90baaf5b829883
32 Source1:        https://github.com/opencontainers/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
33 # Source1-md5:  b593d63c7df5a27fba615afcf411762f
34 Source2:        https://github.com/containerd/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
35 # Source2-md5:  c5cee10a5fb8f6e1d5e186912725a052
36 Source3:        https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
37 # Source3-md5:  a54f3443dbf78696e2470d6657fa03c1
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.12
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:       libseccomp >= 2.3
61 Requires:       rc-scripts >= 0.4.0.10
62 Requires:       systemd-units >= 38
63 Requires:       tar >= 1:1.26
64 Requires:       uname(release) >= 3.8
65 Requires:       xz
66 Suggests:       docker-credential-helpers
67 Suggests:       git-core >= 1.7
68 Suggests:       libcgroup
69 Suggests:       xz >= 1:4.9
70 Provides:       docker = %{version}
71 Provides:       docker(engine) = %{version}
72 Provides:       group(docker)
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} aarch64
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 BuildArch:      noarch
115
116 %description -n bash-completion-%{name}
117 This package provides bash-completion for Docker.
118
119 %description -n bash-completion-%{name} -l pl.UTF-8
120 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
121
122 %package -n zsh-completion-%{name}
123 Summary:        zsh completion for Docker
124 Summary(pl.UTF-8):      Uzupełnianie parametrów w zsh dla poleceń Dockera
125 Group:          Applications/Shells
126 Requires:       %{name}
127 BuildArch:      noarch
128
129 %description -n zsh-completion-%{name}
130 This package provides zsh completion for Docker.
131
132 %description -n zsh-completion-%{name} -l pl.UTF-8
133 Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
134
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 BuildArch:      noarch
142
143 %description -n vim-syntax-%{name}
144 This plugin provides syntax highlighting in Dockerfile.
145
146 %prep
147 %setup -q -n %{name}-%{version}%{?subver} -a1 -a2 -a3 -a4
148
149 mv runc-%{runc_commit}* runc
150 mv runc/vendor runc/src
151 ln -s ../../.. runc/src/github.com/opencontainers/runc
152
153 mv containerd-%{containerd_commit}* containerd
154 mv containerd/vendor containerd/src
155 ln -s ../../.. containerd/src/github.com/containerd/containerd
156
157 mv libnetwork-%{libnetwork_commit}* libnetwork
158 install -d libnetwork/gopath
159 mv libnetwork/vendor libnetwork/gopath/src
160 ln -s ../../../.. libnetwork/gopath/src/github.com/docker/libnetwork
161
162 mv tini-* tini
163
164 install -d components/cli/.gopath/src/github.com/docker
165 ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
166
167 %patch0 -p1 -d components/engine
168
169 %build
170 grep -rhE "=%{runc_commit}|=%{containerd_commit}|=%{libnetwork_commit}" $(pwd)/components/engine/hack/dockerfile/install/
171
172 export VERSION=%{version}-ce # for `docker version`
173 export GITCOMMIT="PLD-Linux/%{version}" # for cli
174 export DOCKER_GITCOMMIT="PLD-Linux/%{version}" # for engine
175 export GO111MODULE=off
176
177 # build runc
178 sed -i -e 's,shell git,shell false,' runc/Makefile
179 GOPATH=$(pwd)/runc \
180 %{__make} -C runc \
181         COMMIT=$RUNC_COMMIT
182 ./runc/runc -v
183
184 # build containerd
185 GOPATH=$(pwd)/containerd \
186 %{__make} -C containerd \
187         GIT_COMMIT=$CONTAINERD_COMMIT
188
189 # build docker-proxy
190 cd libnetwork
191 GOPATH=$(pwd)/gopath \
192 go build -ldflags="-linkmode=external" \
193         -o docker-proxy \
194         github.com/docker/libnetwork/cmd/proxy
195 cd ..
196
197 # build docker-init
198 cd tini
199 cmake .
200 %{__make}
201
202 # docker cli
203 cd ../components/cli
204 GOPATH=$(pwd)/.gopath \
205 DISABLE_WARN_OUTSIDE_CONTAINER=1 \
206 %{__make} dynbinary
207 ./build/docker -v
208
209 cd ../engine
210 AUTO_GOPATH=1 \
211 bash -x hack/make.sh dynbinary
212 ./bundles/dynbinary-daemon/dockerd -v
213 %if %{with doc}
214 man/md2man-all.sh
215 %endif
216
217 %install
218 rm -rf $RPM_BUILD_ROOT
219 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
220         $RPM_BUILD_ROOT%{_sysconfdir}/docker \
221         $RPM_BUILD_ROOT%{_libexecdir} \
222         $RPM_BUILD_ROOT/var/lib/docker/{containers,execdriver,graph,image,init,network,swarm,tmp,trust,vfs,volumes}
223
224 # docker-cli
225 install -p components/cli/build/docker $RPM_BUILD_ROOT%{_bindir}/docker
226
227 # runc
228 install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/runc
229
230 # containerd
231 install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/containerd
232 install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/containerd-shim
233 install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/ctr
234
235 # docker-proxy
236 install -p libnetwork/docker-proxy $RPM_BUILD_ROOT%{_sbindir}/docker-proxy
237
238 # docker-init
239 install -p tini/tini $RPM_BUILD_ROOT%{_sbindir}/docker-init
240
241 # dockerd
242 cd components/engine
243 install -p bundles/dynbinary-daemon/dockerd $RPM_BUILD_ROOT%{_sbindir}/dockerd
244 cp -p contrib/init/systemd/docker.service $RPM_BUILD_ROOT%{systemdunitdir}
245 cp -p contrib/init/systemd/docker.socket $RPM_BUILD_ROOT%{systemdunitdir}
246 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
247 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/dockerd
248 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/docker
249
250 # install udev rules
251 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
252 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
253
254 # vim syntax
255 %if %{with vim}
256 install -d $RPM_BUILD_ROOT%{_vimdatadir}
257 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
258 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
259 %endif
260
261 # bash and zsh completion
262 cd ../cli/contrib/completion
263 install -d $RPM_BUILD_ROOT%{bash_compdir}
264 cp -p bash/docker $RPM_BUILD_ROOT%{bash_compdir}
265 install -d $RPM_BUILD_ROOT%{zsh_compdir}
266 cp -p zsh/_docker $RPM_BUILD_ROOT%{zsh_compdir}
267
268 %pre
269 %groupadd -g 296 docker
270
271 %post
272 /sbin/chkconfig --add docker
273 %service -n docker restart
274 %systemd_post docker.service
275
276 %preun
277 if [ "$1" = "0" ]; then
278         %service -q docker stop
279         /sbin/chkconfig --del docker
280 fi
281 %systemd_preun docker.service
282
283 %postun
284 if [ "$1" = "0" ]; then
285         %groupremove docker
286 fi
287 %systemd_reload
288
289 %triggerun -- docker < 17.0
290 # Prevent preun from docker from working
291 chmod a-x /etc/rc.d/init.d/docker
292
293 %triggerpostun -- docker < 17.0
294 # Restore what triggerun removed
295 chmod 754 /etc/rc.d/init.d/docker
296 # reinstall docker init.d links, which could be different
297 /sbin/chkconfig --del docker
298 /sbin/chkconfig --add docker
299
300 %clean
301 rm -rf $RPM_BUILD_ROOT
302
303 %files
304 %defattr(644,root,root,755)
305 %doc components/engine/{README.md,CHANGELOG.md,CONTRIBUTING.md,LICENSE,AUTHORS,NOTICE,MAINTAINERS}
306 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
307 %attr(754,root,root) /etc/rc.d/init.d/docker
308 %dir %{_sysconfdir}/docker
309 %attr(755,root,root) %{_bindir}/docker
310 %attr(755,root,root) %{_sbindir}/containerd
311 %attr(755,root,root) %{_sbindir}/ctr
312 %attr(755,root,root) %{_sbindir}/containerd-shim
313 %attr(755,root,root) %{_sbindir}/docker-init
314 %attr(755,root,root) %{_sbindir}/docker-proxy
315 %attr(755,root,root) %{_sbindir}/runc
316 %attr(755,root,root) %{_sbindir}/dockerd
317 %attr(755,root,root) %{_libexecdir}/dockerd
318 %{systemdunitdir}/docker.service
319 %{systemdunitdir}/docker.socket
320 /lib/udev/rules.d/80-docker.rules
321
322 %dir %attr(700,root,root) /var/lib/docker
323 %dir %attr(700,root,root) /var/lib/docker/containers
324 %dir %attr(700,root,root) /var/lib/docker/execdriver
325 %dir %attr(700,root,root) /var/lib/docker/graph
326 %dir %attr(700,root,root) /var/lib/docker/image
327 %dir %attr(700,root,root) /var/lib/docker/init
328 %dir %attr(700,root,root) /var/lib/docker/network
329 %dir %attr(700,root,root) /var/lib/docker/swarm
330 %dir %attr(700,root,root) /var/lib/docker/tmp
331 %dir %attr(700,root,root) /var/lib/docker/trust
332 %dir %attr(700,root,root) /var/lib/docker/vfs
333 %dir %attr(700,root,root) /var/lib/docker/volumes
334
335 %files -n bash-completion-%{name}
336 %defattr(644,root,root,755)
337 %{bash_compdir}/docker
338
339 %files -n zsh-completion-%{name}
340 %defattr(644,root,root,755)
341 %{zsh_compdir}/_docker
342
343 %if %{with vim}
344 %files -n vim-syntax-%{name}
345 %defattr(644,root,root,755)
346 %doc components/engine/contrib/syntax/vim/{README.md,LICENSE}
347 %{_vimdatadir}/doc/dockerfile.txt
348 %{_vimdatadir}/ftdetect/dockerfile.vim
349 %{_vimdatadir}/syntax/dockerfile.vim
350 %endif
This page took 0.121918 seconds and 3 git commands to generate.