aboutsummaryrefslogtreecommitdiffstats
path: root/community/docker/APKBUILD
blob: 104021d8696746ead550826d75a22c8734171d2a (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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Maintainer: Eivind Uggedal <eivind@uggedal.com>
pkgname=docker
pkgver=1.12.1
_ver=${pkgver/_/-}
pkgrel=1
_gitcommit=v$_ver
pkgdesc="Pack, ship and run any application as a lightweight container"
url="http://www.docker.io/"
arch="all"
license="ASL 2.0"
depends="iptables git xz"
depends_dev=""
makedepends="go sqlite-dev btrfs-progs-dev bash linux-headers coreutils libseccomp-dev"
options="!strip"
install="$pkgname.pre-install"

# grep 'ENV.*COMMIT' Dockerfile.simple
# ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
# ENV CONTAINERD_COMMIT 0ac3cd1be170d180b2baed755e8f0da547ceb267
_runc_ver=cc29e3dded8e27ba8f65738f40d251c885030a28
_containerd_ver=0ac3cd1be170d180b2baed755e8f0da547ceb267

subpackages="
	$pkgname-bash-completion:bashcomp
	$pkgname-zsh-completion:zshcomp
	$pkgname-vim:vim
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/docker/docker/archive/v$_ver.tar.gz
	runc-$_runc_ver.tar.gz::https://github.com/opencontainers/runc/archive/$_runc_ver.tar.gz
	containerd-$_containerd_ver.tar.gz::https://github.com/docker/containerd/archive/$_containerd_ver.tar.gz

	docker-openrc-fixes.patch
	"

builddir="$srcdir"/$pkgname-$_ver
_buildtags="exclude_graphdriver_aufs exclude_graphdriver_devicemapper"
_runc_buildtags="seccomp"
_runc_builddir="$srcdir"/runc-$_runc_ver

_containerd_builddir="$srcdir"/containerd-$_containerd_ver

_apply_patches() {
	local _dir="$1"
	local _prefix="$2"
	local i
	msg "applying patches for $_prefix"
	cd "$_dir"
	for i in $source; do
		case $i in
		${_prefix}-*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

prepare() {
	_apply_patches "$builddir" docker || return 1
	_apply_patches "$_runc_builddir" runc || return 1
}

build() {
	cd "$_runc_builddir"


	cd "$builddir"

	export AUTO_GOPATH=1
	export DOCKER_GITCOMMIT=$_gitcommit
	export DOCKER_BUILDTAGS=$_buildtags
	unset CC # prevent possible ccache issues

	# containerd
	cd "$_containerd_builddir" || return 1
	mkdir -p src/github.com/docker/
	ln -s "$_containerd_builddir" src/github.com/docker/containerd
	GOPATH="$PWD" LDFLAGS="" make GIT_COMMIT="$_containerd_ver" || return 1

	# runc
	cd "$_runc_builddir" || return 1
	GOPATH="$PWD" make COMMIT="$_runc_ver" || return 1

	# docker
	cd "$builddir"
	./hack/make.sh dynbinary
}

package() {
	cd "$builddir"
	local ver=$(cat VERSION)

	install -Dm755 bundles/$ver/dynbinary-client/docker-$ver \
		"$pkgdir"/usr/bin/docker || return 1

	install -Dm755 bundles/$ver/dynbinary-daemon/dockerd-$ver \
		"$pkgdir"/usr/bin/dockerd || return 1

	install -Dm755 bundles/$ver/dynbinary-daemon/docker-proxy-$ver \
		"$pkgdir"/usr/bin/docker-proxy || return 1

	install -Dm755 "$_runc_builddir"/runc \
		"$pkgdir"/usr/bin/docker-runc || return 1

	install -Dm755 "$_containerd_builddir"/bin/containerd \
		"$pkgdir"/usr/bin/docker-containerd || return 1

	install -Dm755 "$_containerd_builddir"/bin/containerd-shim \
		"$pkgdir"/usr/bin/docker-containerd-shim || return 1

	install -Dm755 "$_containerd_builddir"/bin/ctr \
		"$pkgdir"/usr/bin/docker-containerd-ctr || return 1

	install -Dm755 bundles/$ver/dynbinary/dockerinit-$ver \
		"$pkgdir"/usr/lib/docker/dockerinit
	install -Dm755 contrib/init/openrc/docker.initd \
		"$pkgdir"/etc/init.d/docker
	install -Dm644 contrib/init/openrc/docker.confd \
		"$pkgdir"/etc/conf.d/docker
}

bashcomp() {
	pkgdesc="Bash completion for Docker"
	arch="noarch"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$builddir"/contrib/completion/bash/$pkgname \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname
}

zshcomp() {
	pkgdesc="Zsh completion for $pkgname"
	arch="noarch"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	install -Dm644 "$builddir"/contrib/completion/zsh/_$pkgname \
		"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname || return 1
}

vim() {
	depends=""
	pkgdesc="Vim syntax for Docker"
	arch="noarch"

	local f=
	for f in ftdetect/dockerfile.vim syntax/dockerfile.vim; do
		install -Dm644 "$builddir"/contrib/syntax/vim/$f \
			"$subpkgdir"/usr/share/vim/vimfiles/$f
	done
}

md5sums="7af7b4c25d414aa19bc7382bd85c25f7  docker-1.12.1.tar.gz
716d0b284ce42490eeb83befba10fafb  runc-cc29e3dded8e27ba8f65738f40d251c885030a28.tar.gz
f0a0c1101ad259b84fb457c8c7036723  containerd-0ac3cd1be170d180b2baed755e8f0da547ceb267.tar.gz
41d0008283777d8ea7e8ab6ebe230c07  docker-openrc-fixes.patch"
sha256sums="0c71255fc69ffec377800468e2b1c97681f150f3719ffa09829a17b717ff4e01  docker-1.12.1.tar.gz
196b78c6caf1a4c6257314b393381baffa7c82bb2690ac02a7b3d6cd6cfe7776  runc-cc29e3dded8e27ba8f65738f40d251c885030a28.tar.gz
5c1bcd8e3b7bc6034e7523b6eca7de974562b7fdc72c440494234ae10a0e545b  containerd-0ac3cd1be170d180b2baed755e8f0da547ceb267.tar.gz
13835e08cc7a7a530f19a037d9e1442f1393a6573bec60fe9d41b434c460200d  docker-openrc-fixes.patch"
sha512sums="8917e23d2826f45951710dcc47625c272405466661b7fa6b75fb7e143fdcc5c78cbf6a7475663b96b22126ba3c2dab3b3a8c11ca396dc8408d1aa9f2667c95e7  docker-1.12.1.tar.gz
0bf8ce3bb15caaf09214f23a411003fd5b660d291662ad513c3d944647a0fa9b270d18902706b7e6aa3c30eb0f676e73af46b8249d1e2484e1dc40d6ffd5a80d  runc-cc29e3dded8e27ba8f65738f40d251c885030a28.tar.gz
a47200c2f867d6624e51eb1aa83743f1e0b86d96d462b7649c240f335eb72e499a00923e190759e57d4c456d912f9541750e9df21ebc2b713b87bea1ead55e7b  containerd-0ac3cd1be170d180b2baed755e8f0da547ceb267.tar.gz
42f35d9e7a82f6f4cc0b6a6ecfc1a970f935c54aa639873a49c5be5dc62a50503a9435ddfe5af74d378e1297b0e1509f5cbe84a7ba98bd0b51deeaa25495415d  docker-openrc-fixes.patch"