Browse code

Building docker from source

Change-Id: I86512becc8a4fb35c6f98ee7ba43b955dd76bb17
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2405
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

Kumar Kaushik authored on 2017/04/13 09:33:40
Showing 1 changed files
... ...
@@ -1,33 +1,86 @@
1 1
 Summary:        Docker
2 2
 Name:           docker
3
-Version:        1.12.6
3
+Version:        1.13.1
4 4
 Release:        1%{?dist}
5 5
 License:        ASL 2.0
6 6
 URL:            http://docs.docker.com
7 7
 Group:          Applications/File
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10
-Source0:        https://get.docker.com/builds/Linux/x86_64/%{name}-%{version}.tgz 
11
-%define sha1 docker=53e47bc1c888279753c474c7c75c4e6756422165
12
-Source1:        docker.service
13
-Source2:        docker-containerd.service
14
-Source3:        docker-completion.bash
10
+Source0:        https://github.com/docker/docker/archive/%{name}-%{version}.tar.gz
11
+%define sha1 docker=8a39c44c9e665495484fd86fbefdfbc9ab9d815d 
12
+Source1:        https://github.com/docker/containerd/archive/containerd-0.2.5.tar.gz
13
+%define sha1 containerd=aaf6fd1c5176b8575af1d8edf82af3d733528451
14
+Source2:        https://github.com/opencontainers/runc/archive/runc-1.0.0-rc2.tar.gz
15
+%define sha1 runc=27ab28ba1c81c4f2f62ed11601f8e3a2fafd229f
16
+Source3:        https://github.com/docker/libnetwork/archive/docker-libnetwork-master-0.8.1.tar.gz
17
+%define sha1 docker-libnetwork-master=231c59f72a17f5e3f33e75e1efa164623e1852d8
18
+Source4:        docker.service
19
+Source5:        docker-containerd.service
20
+Source6:        docker-completion.bash
21
+
15 22
 BuildRequires:  systemd
23
+BuildRequires:  device-mapper-devel
24
+BuildRequires:  btrfs-progs-devel
25
+BuildRequires:  libseccomp
26
+BuildRequires:  libseccomp-devel
27
+Requires:       libgcc
28
+Requires:       glibc
29
+Requires:       libseccomp
16 30
 Requires:       systemd
31
+Requires:       device-mapper-libs
17 32
 
18 33
 %description
19 34
 Docker is a platform for developers and sysadmins to develop, ship and run applications.
20 35
 %prep
21
-%setup -qn docker
36
+%setup -q
37
+%setup -T -D -a 1
38
+%setup -T -D -a 2
39
+%setup -T -D -a 3
40
+
22 41
 %build
42
+
43
+export AUTO_GOPATH=1
44
+export DOCKER_BUILDTAGS='exclude_graphdriver_aufs'
45
+export DOCKER_GITCOMMIT="092cba3"
46
+
47
+./hack/make.sh dynbinary
48
+
49
+mkdir -p /usr/share/gocode/src/github.com/docker/
50
+cd /usr/share/gocode/src/github.com/docker/
51
+mv /usr/src/photon/BUILD/docker-1.13.1/containerd-0.2.5 .
52
+mv containerd-0.2.5 containerd
53
+cd containerd
54
+
55
+make
56
+
57
+mkdir -p /usr/share/gocode/src/github.com/opencontainers/
58
+cd /usr/share/gocode/src/github.com/opencontainers/
59
+mv /usr/src/photon/BUILD/docker-1.13.1/runc-1.0.0-rc2 .
60
+mv runc-1.0.0-rc2 runc
61
+cd runc
62
+make BUILDTAGS='seccomp'
63
+
64
+cd /usr/share/gocode/src/github.com/docker/
65
+mv /usr/src/photon/BUILD/docker-1.13.1/libnetwork-master/ .
66
+mv libnetwork-master libnetwork
67
+cd libnetwork
68
+go build -ldflags="-linkmode=external" -o docker-proxy github.com/docker/libnetwork/cmd/proxy
69
+
23 70
 %install
24 71
 install -vdm755 %{buildroot}/usr/bin
25
-mv -v %{_builddir}/%{name}/* %{buildroot}/usr/bin/
72
+mv -v %{_builddir}/%{name}-%{version}/bundles/latest/dynbinary-client/%{name}-%{version} %{buildroot}/usr/bin/%{name}
73
+mv -v %{_builddir}/%{name}-%{version}/bundles/latest/dynbinary-daemon/%{name}d-%{version} %{buildroot}/usr/bin/%{name}d
74
+mv -v /usr/share/gocode/src/github.com/docker/containerd/bin/containerd %{buildroot}/usr/bin/%{name}-containerd
75
+mv -v /usr/share/gocode/src/github.com/docker/containerd/bin/containerd-shim %{buildroot}/usr/bin/%{name}-containerd-shim
76
+mv -v /usr/share/gocode/src/github.com/docker/containerd/bin/ctr %{buildroot}/usr/bin/%{name}-containerd-ctr
77
+mv -v /usr/share/gocode/src/github.com/opencontainers/runc/runc %{buildroot}/usr/bin/%{name}-runc
78
+mv -v /usr/share/gocode/src/github.com/docker/libnetwork/docker-proxy %{buildroot}/usr/bin/%{name}-proxy
26 79
 install -vd %{buildroot}/lib/systemd/system
27
-cp %{SOURCE1} %{buildroot}/lib/systemd/system/docker.service
28
-cp %{SOURCE2} %{buildroot}/lib/systemd/system/docker-containerd.service
80
+cp %{SOURCE4} %{buildroot}/lib/systemd/system/docker.service
81
+cp %{SOURCE5} %{buildroot}/lib/systemd/system/docker-containerd.service
29 82
 install -vdm 755 %{buildroot}%{_datadir}/bash-completion/completions
30
-install -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/bash-completion/completions/docker
83
+install -m 0644 %{SOURCE6} %{buildroot}%{_datadir}/bash-completion/completions/docker
31 84
 
32 85
 %{_fixperms} %{buildroot}/*
33 86
 %check
... ...
@@ -48,14 +101,24 @@ make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
48 48
 
49 49
 %clean
50 50
 rm -rf %{buildroot}/*
51
+
51 52
 %files
52 53
 %defattr(-,root,root)
53
-%{_bindir}
54
-/lib/systemd/system/docker.service
55 54
 /lib/systemd/system/docker-containerd.service
56
-%{_datadir}/bash-completion/completions/docker
55
+/lib/systemd/system/docker.service
56
+/usr/bin
57
+/usr/bin/docker
58
+/usr/bin/docker-containerd
59
+/usr/bin/docker-containerd-ctr
60
+/usr/bin/docker-containerd-shim
61
+/usr/bin/docker-proxy
62
+/usr/bin/docker-runc
63
+/usr/bin/dockerd
64
+/usr/share/bash-completion/completions/docker
57 65
 
58 66
 %changelog
67
+*   Tue Apr 11 2017 Kumar Kaushik <kaushikk@vmware.com> 1.13.1-1
68
+-   Building docker from source.
59 69
 *   Fri Jan 13 2017 Xiaolin Li <xiaolinl@vmware.com> 1.12.6-1
60 70
 -   Upgraded to version 1.12.6
61 71
 *   Wed Sep 21 2016 Xiaolin Li <xiaolinl@vmware.com> 1.12.1-1
... ...
@@ -93,5 +156,5 @@ rm -rf %{buildroot}/*
93 93
 -   Update according to UsrMove.
94 94
 *   Fri May 15 2015 Divya Thaluru <dthaluru@vmware.com> 1.6.0-2
95 95
 -   Updated to version 1.6
96
-*   Mon Mar 4 2015 Divya Thaluru <dthaluru@vmware.com> 1.5.0-1
96
+*   Wed Mar 4 2015 Divya Thaluru <dthaluru@vmware.com> 1.5.0-1
97 97
 -   Initial build. First version