]> git.pld-linux.org Git - packages/docker-ce.git/blame - docker-ce.spec
cli: DISABLE_WARN_OUTSIDE_CONTAINER=1
[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
ER
9# NOTES
10# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
11
ed3d2488
ER
12# v1.0.0-rc2-528-g3f2f8b84
13%define runc_commit 3f2f8b8
14# v0.2.9-27-g06b9cb35
15%define containerd_commit 06b9cb3
d83187b3
ER
16# v0.8.0-dev.2-624-g7b2b1feb
17%define libnetwork_commit 7b2b1fe
027e5a65 18#define subver -rc2
8716e3f7
ER
19Summary: Docker CE: the open-source application container engine
20Name: docker-ce
21# Using Docker-CE, Stay on Stable channel
22# https://docs.docker.com/engine/installation/
ed3d2488 23Version: 17.09.0
027e5a65 24Release: 1
b877f7b7
ER
25License: Apache v2.0
26Group: Applications/System
d83187b3 27# https://github.com/docker/docker-ce/releases
027e5a65
ER
28#Source0: https://github.com/docker/docker-ce/archive/v%{version}-ce%{subver}/%{name}-%{version}-ce%{subver}.tar.gz
29Source0: https://github.com/docker/docker-ce/archive/v%{version}-ce/%{name}-%{version}-ce.tar.gz
30# Source0-md5: e0df90392b2daa545562342dabf181cf
7c769496 31Source1: https://github.com/docker/runc/archive/%{runc_commit}/runc-%{runc_commit}.tar.gz
ed3d2488
ER
32# Source1-md5: 0dc3b1eafba193280d6cf6ffa46c2521
33Source2: https://github.com/containerd/containerd/archive/%{containerd_commit}/containerd-%{containerd_commit}.tar.gz
34# Source2-md5: 202389709618a6b181216e99718f0132
a75f03e6 35Source3: https://github.com/docker/libnetwork/archive/%{libnetwork_commit}/libnetwork-%{libnetwork_commit}.tar.gz
ed3d2488 36# Source3-md5: a9beb9207b291373dc4e376f04056e8a
b96d9f58
ER
37Source4: https://github.com/krallin/tini/archive/v0.13.0/tini-0.13.0.tar.gz
38# Source4-md5: c29541112a242c53c82bb6b1213f288f
8716e3f7
ER
39Source5: dockerd.sh
40Source7: docker.init
41Source8: docker.sysconfig
b6f967da 42Patch0: systemd.patch
8716e3f7 43URL: https://www.docker.com/community-edition/
be6486fd 44BuildRequires: btrfs-progs-devel >= 3.16.1
6dee0436 45BuildRequires: cmake
be6486fd 46BuildRequires: device-mapper-devel >= 2.02.89
d9a3d699 47BuildRequires: golang >= 1.6
be6486fd 48BuildRequires: libseccomp-devel >= 2.2.1
0be68701 49BuildRequires: rpmbuild(macros) >= 1.644
678a84bd 50BuildRequires: sqlite3-devel >= 3.7.9
d88043a2
ER
51Requires(post,preun): /sbin/chkconfig
52Requires(postun): /usr/sbin/groupdel
53Requires(pre): /usr/bin/getgid
54Requires(pre): /usr/sbin/groupadd
27e7cc0f 55Requires: ca-certificates
2e42e913 56Requires: iproute2 >= 3.5
b5920dfc 57Requires: iptables
345101bd 58Requires: rc-scripts >= 0.4.0.10
0be68701 59Requires: systemd-units >= 38
2e42e913 60Requires: tar >= 1:1.26
2015cb19 61Requires: uname(release) >= 3.8
db150373 62Requires: xz
65777843 63Suggests: docker-credential-helpers
2e42e913 64Suggests: git-core >= 1.7
46a6d8ab 65Suggests: libcgroup
2e42e913 66Suggests: xz >= 1:4.9
8eac6649
ER
67Provides: docker = %{version}
68Provides: docker(engine) = %{version}
d88043a2 69Provides: group(docker)
23955a7a 70Obsoletes: docker < 17.0
47009a45 71Obsoletes: lxc-docker < 1.1.1
d2670441 72# only runs on x64 hosts for now:
f4565fa4
ER
73# https://github.com/docker/docker/issues/136
74# https://github.com/docker/docker/issues/611
345101bd 75ExclusiveArch: %{x8664}
b877f7b7
ER
76BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77
8c352669 78%define bash_compdir %{_datadir}/bash-completion/completions
a6da47b4 79%define zsh_compdir %{_datadir}/zsh/site-functions
f891ae41 80%define _vimdatadir %{_datadir}/vim
a990be6d 81%define _libexecdir %{_prefix}/lib
8c352669 82
434d66d3
ER
83# binary stripped or something
84%define _enable_debug_packages 0
85
b877f7b7 86%description
f4565fa4
ER
87Docker is an open source project to pack, ship and run any application
88as a lightweight container
89
90Docker containers are both hardware-agnostic and platform-agnostic.
91This means that they can run anywhere, from your laptop to the largest
92EC2 compute instance and everything in between - and they don't
93require that you use a particular language, framework or packaging
94system. That makes them great building blocks for deploying and
95scaling web apps, databases and backend services without depending on
96a particular stack or provider.
97
98Docker is an open-source implementation of the deployment engine which
99powers dotCloud, a popular Platform-as-a-Service. It benefits directly
100from the experience accumulated over several years of large-scale
101operation and support of hundreds of thousands of applications and
102databases.
b877f7b7 103
f891ae41 104%package -n bash-completion-%{name}
8c352669
ER
105Summary: bash-completion for Docker
106Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera
107Group: Applications/Shells
108Requires: %{name}
109Requires: bash-completion >= 2.0
47009a45 110Obsoletes: bash-completion-lxc-docker < 1.1.1
8c352669
ER
111%if "%{_rpmversion}" >= "5"
112BuildArch: noarch
113%endif
114
47009a45 115%description -n bash-completion-%{name}
8c352669
ER
116This package provides bash-completion for Docker.
117
47009a45 118%description -n bash-completion-%{name} -l pl.UTF-8
8c352669
ER
119Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
120
a6da47b4
JK
121%package -n zsh-completion-%{name}
122Summary: zsh completion for Docker
123Summary(pl.UTF-8): Uzupełnianie parametrów w zsh dla poleceń Dockera
124Group: Applications/Shells
125Requires: %{name}
126%if "%{_rpmversion}" >= "5"
127BuildArch: noarch
128%endif
129
130%description -n zsh-completion-%{name}
131This package provides zsh completion for Docker.
132
133%description -n zsh-completion-%{name} -l pl.UTF-8
134Pakiet ten dostarcza uzupełnianie w zsh dla poleceń Dockera.
135
f891ae41
ER
136%package -n vim-syntax-%{name}
137Summary: Vim syntax: Docker
138Group: Applications/Editors/Vim
139Requires: %{name} = %{version}-%{release}
140Requires: vim-rt >= 4:7.2.170
47009a45 141Obsoletes: vim-syntax-lxc-docker < 1.1.1
f891ae41
ER
142%if "%{_rpmversion}" >= "5"
143BuildArch: noarch
144%endif
145
146%description -n vim-syntax-%{name}
147This plugin provides syntax highlighting in Dockerfile.
148
b877f7b7 149%prep
ed3d2488 150%setup -q -n %{name}-%{version}-ce%{?subver} -a1 -a2 -a3 -a4
3fe85ad0
ER
151
152mv runc-%{runc_commit}* runc
153mv runc/vendor runc/src
154ln -s ../../.. runc/src/github.com/opencontainers/runc
155
156mv containerd-%{containerd_commit}* containerd
ed3d2488
ER
157mv containerd/vendor containerd/src
158ln -s ../../.. containerd/src/github.com/containerd/containerd
3fe85ad0
ER
159
160mv libnetwork-%{libnetwork_commit}* libnetwork
161install -d libnetwork/gopath
162mv libnetwork/vendor libnetwork/gopath/src
163ln -s ../../../.. libnetwork/gopath/src/github.com/docker/libnetwork
164
b96d9f58 165mv tini-* tini
36f21c65 166
f47d9fe1
ER
167install -d components/cli/.gopath/src/github.com/docker
168ln -s ../../../.. components/cli/.gopath/src/github.com/docker/cli
d83187b3 169
f47d9fe1 170%patch0 -p1 -d components/engine
b877f7b7 171
692548c0 172%build
4f00b115
ER
173. components/engine/hack/dockerfile/binaries-commits
174echo "$RUNC_COMMIT" | grep "^%{runc_commit}"
175echo "$CONTAINERD_COMMIT" | grep "^%{containerd_commit}"
176echo "$LIBNETWORK_COMMIT" | grep "^%{libnetwork_commit}"
36f21c65 177
b3c6f3dc
ER
178export VERSION=%{version}
179export GITCOMMIT="pld/%{version}" # for cli
180export DOCKER_GITCOMMIT="pld/%{version}" # for engine
181
36f21c65 182# build docker-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
ER
188
189# build docker-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
3fe85ad0 231# docker-runc
36f21c65
ER
232install -p runc/runc $RPM_BUILD_ROOT%{_sbindir}/docker-runc
233
3fe85ad0 234# docker-containerd
36f21c65
ER
235install -p containerd/bin/containerd $RPM_BUILD_ROOT%{_sbindir}/docker-containerd
236install -p containerd/bin/containerd-shim $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-shim
6a5abe01 237install -p containerd/bin/ctr $RPM_BUILD_ROOT%{_sbindir}/docker-containerd-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
36f21c65 313%attr(755,root,root) %{_sbindir}/docker-containerd
6a5abe01 314%attr(755,root,root) %{_sbindir}/docker-containerd-ctr
36f21c65 315%attr(755,root,root) %{_sbindir}/docker-containerd-shim
b96d9f58 316%attr(755,root,root) %{_sbindir}/docker-init
4467217c
ER
317%attr(755,root,root) %{_sbindir}/docker-proxy
318%attr(755,root,root) %{_sbindir}/docker-runc
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.21673 seconds and 4 git commands to generate.