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