Browse code

Update/fix build tags, Dockerfile, and release.sh for proper building and releasing of linux/386 and linux/arm cross-compiled client binaries

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)

Tianon Gravi authored on 2014/01/31 19:16:42
Showing 33 changed files
... ...
@@ -68,8 +68,9 @@ ENV	GOPATH	/go:/go/src/github.com/dotcloud/docker/vendor
68 68
 RUN	cd /usr/local/go/src && ./make.bash --no-clean 2>&1
69 69
 
70 70
 # Compile Go for cross compilation
71
-ENV	DOCKER_CROSSPLATFORMS	darwin/amd64 darwin/386
72
-# TODO add linux/386 and linux/arm
71
+ENV	DOCKER_CROSSPLATFORMS	linux/386 linux/arm darwin/amd64 darwin/386
72
+# (set an explicit GOARM of 5 for maximum compatibility)
73
+ENV	GOARM	5
73 74
 RUN	cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'
74 75
 
75 76
 # Grab Go's cover tool for dead-simple code coverage testing
76 77
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+// +build !linux !amd64
1
+
2
+package archive
3
+
4
+import "syscall"
5
+
6
+func getLastAccess(stat *syscall.Stat_t) syscall.Timespec {
7
+	return stat.Atimespec
8
+}
9
+
10
+func getLastModification(stat *syscall.Stat_t) syscall.Timespec {
11
+	return stat.Mtimespec
12
+}
13
+
14
+func LUtimesNano(path string, ts []syscall.Timespec) error {
15
+	return nil
16
+}
0 17
deleted file mode 100644
... ...
@@ -1,16 +0,0 @@
1
-// +build: !linux !amd64
2
-package archive
3
-
4
-import "syscall"
5
-
6
-func getLastAccess(stat *syscall.Stat_t) syscall.Timespec {
7
-	return stat.Atimespec
8
-}
9
-
10
-func getLastModification(stat *syscall.Stat_t) syscall.Timespec {
11
-	return stat.Mtimespec
12
-}
13
-
14
-func LUtimesNano(path string, ts []syscall.Timespec) error {
15
-	return nil
16
-}
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package lxc
2 4
 
3 5
 import (
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package lxc
3 4
 
4 5
 func setHostname(hostname string) error {
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package aufs
2 4
 
3 5
 import "syscall"
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package aufs
3 4
 
4 5
 import "errors"
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package btrfs
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-// +build linux
1
+// +build linux,amd64
2 2
 
3 3
 package devmapper
4 4
 
... ...
@@ -151,7 +151,8 @@ release_build() {
151 151
 			S3ARCH=i386
152 152
 			;;
153 153
 		arm)
154
-			# GOARCH is fine
154
+			S3ARCH=armel
155
+			# someday, we might potentially support mutliple GOARM values, in which case we might get armhf here too
155 156
 			;;
156 157
 		*)
157 158
 			echo >&2 "error: can't convert $S3ARCH to an appropriate value for 'uname -m'"
158 159
deleted file mode 100644
... ...
@@ -1,5 +0,0 @@
1
-package graphdb
2
-
3
-func NewSqliteConn(root string) (*Database, error) {
4
-	panic("Not implemented")
5
-}
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package graphdb
2 4
 
3 5
 import (
4 6
new file mode 100644
... ...
@@ -0,0 +1,7 @@
0
+// +build !linux !amd64
1
+
2
+package graphdb
3
+
4
+func NewSqliteConn(root string) (*Database, error) {
5
+	panic("Not implemented")
6
+}
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package mount
2 4
 
3 5
 import (
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package mount
3 4
 
4 5
 func parseOptions(options string) (int, string) {
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package mount
2 4
 
3 5
 import (
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package mount
3 4
 
4 5
 func mount(device, target, mType string, flag uintptr, data string) error {
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package netlink
2 4
 
3 5
 import (
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package netlink
3 4
 
4 5
 import (
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package docker
2 4
 
3 5
 // FIXME: This could be easily rewritten in pure Go
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package docker
3 4
 
4 5
 import (
... ...
@@ -1,3 +1,5 @@
1
+// +build amd64
2
+
1 3
 package utils
2 4
 
3 5
 import (
... ...
@@ -1,4 +1,5 @@
1
-// +build: !linux !amd64
1
+// +build !linux !amd64
2
+
2 3
 package utils
3 4
 
4 5
 import (