blob: 355eb3d78ff4fa2d964e18590924f74b00f6ca8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
%define docker_path /src/github.com/docker
%define runc_path /src/github.com/opencontainers
%define container_path /src/github.com/containerd
%define go_version 1.8.3
%define orig_version %{version}-ce
Name: docker-engine
Version: 17.06.1
Release: 0
Summary: The open-source application container engine
Group: Tools/Docker
License: ASL 2.0
ExclusiveArch: armv7l
Source0: %{name}.tar.gz
Source1: %{name}.manifest
Source2: %{name}.service
Source3: %{name}.socket
Source11: go1.8.3.linux-amd64.tar.gz
Source12: go1.8.3.linux-armv7.tar.gz
Source13: docker-ce.tar.bz2
Source14: containerd.tar.bz2
Source15: runc.tar.bz2
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%description
Docker is an open source project to build, ship and run any application as a
lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest EC2 compute instance and
everything in between - and they don't require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
%prep
%setup -q
%ifarch armv7l
cp %{SOURCE12} .
tar -zxf %{SOURCE12}
rm -f %{_builddir}/%{name}-%{version}/go%{go_version}.linux-armv7.tar.gz
%endif
%ifarch x86_64
cp %{SOURCE11} .
tar -zxf %{SOURCE11}
rm -f %{_builddir}/%{name}-%{version}/go%{go_version}.linux-amd64.tar.gz
%endif
chmod g-w %_sourcedir/*
cp %{SOURCE1} ./%{name}.manifest
# docker-ce tar file
cp %{SOURCE13} .
tar -xvf %{SOURCE13}
# containerd tar file
cp %{SOURCE14} .
tar -xvf %{SOURCE14}
# runc tar file
cp %{SOURCE15} .
tar -xvf %{SOURCE15}
## set docker build folder
mkdir -p .%docker_path/
mkdir -p .%docker_path/engine
mkdir -p .%docker_path/cli
mkdir -p .%container_path/containerd
mkdir -p .%runc_path/
mkdir -p .%runc_path/runc
cd ext/docker-ce/components/engine
mv `ls . | grep -v packaging | grep -v src` ../../../..%docker_path/engine
cd ../cli/
mv `ls . | grep -v packaging | grep -v src` ../../../..%docker_path/cli
cd ../../../containerd/
mv `ls . | grep -v packaging | grep -v src` ../..%container_path/containerd
cd ../runc/
mv `ls . | grep -v packaging | grep -v src` ../..%runc_path/runc
cd ../../
## service
cp %{SOURCE2} ./%{name}.services
cp %{SOURCE3} ./%{name}.socket
%build
cd .%docker_path/engine
export GOROOT=%{_builddir}/%{name}-%{version}/go
export PATH=$PATH:%{_builddir}/%{name}-%{version}/go/bin
export GOPATH=%{_builddir}/%{name}-%{version}
export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper'
go env
echo "skip docker daemon build"
echo "will be used from docker-ec build result"
###echo 'docker daemon'
###export CGO_ENABLED=1
###AUTO_GOPATH=1 ./hack/make.sh dynbinary
echo 'docker cli'
cd ../cli
make binary
export BUILDTAGS=no_btrfs
echo 'containerd build'
cd ../../containerd/containerd
make
echo 'runc build'
cd ../../opencontainers/runc
make all BUILDTAGS=""
%install
rm -rf %{buildroot}
# install binary
install -d $RPM_BUILD_ROOT/%{_bindir}
install -p -m 755 .%docker_path/cli/build/docker-linux-arm $RPM_BUILD_ROOT/%{_bindir}/docker
install -p -m 755 .%docker_path/engine/bundles/%{orig_version}/dynbinary-daemon/dockerd-%{orig_version} $RPM_BUILD_ROOT/%{_bindir}/dockerd
install -p -m 755 .%runc_path/runc/runc $RPM_BUILD_ROOT/%{_bindir}/docker-runc
install -p -m 755 .%container_path/containerd/bin/containerd $RPM_BUILD_ROOT/%{_bindir}/docker-containerd
install -p -m 755 .%container_path/containerd/bin/containerd-shim $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-shim
install -p -m 755 .%container_path/containerd/bin/ctr $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-ctr
mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
### mkdir -p %{buildroot}/usr/lib/systemd/system/sockets.target.wants
### install -m 0644 %SOURCE2 %{buildroot}/usr/lib/systemd/system/%{name}.service
### ln -s ../%{name}.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/
### install -m 0644 %SOURCE3 %{buildroot}/usr/lib/systemd/system/%{name}.socket
### ln -s ../%{name}.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
/%{_bindir}/docker
/%{_bindir}/dockerd
/%{_bindir}/docker-containerd
/%{_bindir}/docker-containerd-shim
/%{_bindir}/docker-containerd-ctr
/%{_bindir}/docker-runc
### /usr/lib/systemd/system/%{name}.service
### /usr/lib/systemd/system/multi-user.target.wants/%{name}.service
### /usr/lib/systemd/system/%{name}.socket
### /usr/lib/systemd/system/sockets.target.wants/%{name}.socket
%license .%docker_path/engine/LICENSE
|