Browse Source

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 11 years ago
parent
commit
065dd231dd

+ 3 - 2
Dockerfile

@@ -68,8 +68,9 @@ ENV	GOPATH	/go:/go/src/github.com/dotcloud/docker/vendor
 RUN	cd /usr/local/go/src && ./make.bash --no-clean 2>&1
 RUN	cd /usr/local/go/src && ./make.bash --no-clean 2>&1
 
 
 # Compile Go for cross compilation
 # Compile Go for cross compilation
-ENV	DOCKER_CROSSPLATFORMS	darwin/amd64 darwin/386
-# TODO add linux/386 and linux/arm
+ENV	DOCKER_CROSSPLATFORMS	linux/386 linux/arm darwin/amd64 darwin/386
+# (set an explicit GOARM of 5 for maximum compatibility)
+ENV	GOARM	5
 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'
 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'
 
 
 # Grab Go's cover tool for dead-simple code coverage testing
 # Grab Go's cover tool for dead-simple code coverage testing

+ 2 - 1
archive/stat_unsupported.go → archive/stat_darwin.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package archive
 package archive
 
 
 import "syscall"
 import "syscall"

+ 2 - 0
execdriver/lxc/lxc_init_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package lxc
 package lxc
 
 
 import (
 import (

+ 2 - 1
execdriver/lxc/lxc_init_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package lxc
 package lxc
 
 
 func setHostname(hostname string) error {
 func setHostname(hostname string) error {

+ 2 - 0
graphdriver/aufs/mount_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package aufs
 package aufs
 
 
 import "syscall"
 import "syscall"

+ 2 - 1
graphdriver/aufs/mount_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package aufs
 package aufs
 
 
 import "errors"
 import "errors"

+ 1 - 1
graphdriver/btrfs/btrfs.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package btrfs
 package btrfs
 
 

+ 1 - 1
graphdriver/devmapper/attach_loopback.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/deviceset.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/devmapper.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/devmapper_log.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/devmapper_test.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/devmapper_wrapper.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/driver.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/driver_test.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/ioctl.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/mount.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 1 - 1
graphdriver/devmapper/sys.go

@@ -1,4 +1,4 @@
-// +build linux
+// +build linux,amd64
 
 
 package devmapper
 package devmapper
 
 

+ 2 - 1
hack/release.sh

@@ -151,7 +151,8 @@ release_build() {
 			S3ARCH=i386
 			S3ARCH=i386
 			;;
 			;;
 		arm)
 		arm)
-			# GOARCH is fine
+			S3ARCH=armel
+			# someday, we might potentially support mutliple GOARM values, in which case we might get armhf here too
 			;;
 			;;
 		*)
 		*)
 			echo >&2 "error: can't convert $S3ARCH to an appropriate value for 'uname -m'"
 			echo >&2 "error: can't convert $S3ARCH to an appropriate value for 'uname -m'"

+ 2 - 0
pkg/graphdb/conn_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package graphdb
 package graphdb
 
 
 import (
 import (

+ 2 - 0
pkg/graphdb/conn_darwin.go → pkg/graphdb/conn_unsupported.go

@@ -1,3 +1,5 @@
+// +build !linux !amd64
+
 package graphdb
 package graphdb
 
 
 func NewSqliteConn(root string) (*Database, error) {
 func NewSqliteConn(root string) (*Database, error) {

+ 2 - 0
pkg/mount/flags_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package mount
 package mount
 
 
 import (
 import (

+ 2 - 1
pkg/mount/flags_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package mount
 package mount
 
 
 func parseOptions(options string) (int, string) {
 func parseOptions(options string) (int, string) {

+ 2 - 0
pkg/mount/mounter_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package mount
 package mount
 
 
 import (
 import (

+ 2 - 1
pkg/mount/mounter_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package mount
 package mount
 
 
 func mount(device, target, mType string, flag uintptr, data string) error {
 func mount(device, target, mType string, flag uintptr, data string) error {

+ 2 - 0
pkg/netlink/netlink_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package netlink
 package netlink
 
 
 import (
 import (

+ 2 - 1
pkg/netlink/netlink_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package netlink
 package netlink
 
 
 import (
 import (

+ 2 - 0
reflink_copy_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package docker
 package docker
 
 
 // FIXME: This could be easily rewritten in pure Go
 // FIXME: This could be easily rewritten in pure Go

+ 2 - 1
reflink_copy_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package docker
 package docker
 
 
 import (
 import (

+ 2 - 0
utils/uname_linux.go

@@ -1,3 +1,5 @@
+// +build amd64
+
 package utils
 package utils
 
 
 import (
 import (

+ 2 - 1
utils/uname_unsupported.go

@@ -1,4 +1,5 @@
-// +build: !linux !amd64
+// +build !linux !amd64
+
 package utils
 package utils
 
 
 import (
 import (