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