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