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