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