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