Skip to content

Commit

Permalink
Merge pull request #4 from tianon/cross-compile-and-release-linux-i38…
Browse files Browse the repository at this point in the history
…6-and-arm-clients

Update/fix build tags, Dockerfile, and release.sh for proper building and releasing of linux/386 and linux/arm cross-compiled client binaries
  • Loading branch information
creack committed Jan 31, 2014
2 parents 45dd051 + 065dd23 commit ff64093
Show file tree
Hide file tree
Showing 31 changed files with 51 additions and 23 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Expand Up @@ -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

# 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'

# Grab Go's cover tool for dead-simple code coverage testing
Expand Down
3 changes: 2 additions & 1 deletion archive/stat_unsupported.go → archive/stat_darwin.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package archive

import "syscall"
Expand Down
2 changes: 2 additions & 0 deletions execdriver/lxc/lxc_init_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package lxc

import (
Expand Down
3 changes: 2 additions & 1 deletion execdriver/lxc/lxc_init_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package lxc

func setHostname(hostname string) error {
Expand Down
2 changes: 2 additions & 0 deletions graphdriver/aufs/mount_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package aufs

import "syscall"
Expand Down
3 changes: 2 additions & 1 deletion graphdriver/aufs/mount_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package aufs

import "errors"
Expand Down
2 changes: 1 addition & 1 deletion graphdriver/btrfs/btrfs.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package btrfs

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/attach_loopback.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/deviceset.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/devmapper.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/devmapper_log.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/devmapper_test.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/devmapper_wrapper.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/driver.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/driver_test.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/ioctl.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/mount.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
2 changes: 1 addition & 1 deletion graphdriver/devmapper/sys.go
@@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64

package devmapper

Expand Down
3 changes: 2 additions & 1 deletion hack/release.sh
Expand Up @@ -151,7 +151,8 @@ release_build() {
S3ARCH=i386
;;
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'"
Expand Down
2 changes: 2 additions & 0 deletions pkg/graphdb/conn_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package graphdb

import (
Expand Down
@@ -1,3 +1,5 @@
// +build !linux !amd64

package graphdb

func NewSqliteConn(root string) (*Database, error) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/mount/flags_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package mount

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/mount/flags_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package mount

func parseOptions(options string) (int, string) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/mount/mounter_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package mount

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/mount/mounter_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package mount

func mount(device, target, mType string, flag uintptr, data string) error {
Expand Down
2 changes: 2 additions & 0 deletions pkg/netlink/netlink_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package netlink

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/netlink/netlink_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package netlink

import (
Expand Down
2 changes: 2 additions & 0 deletions reflink_copy_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package docker

// FIXME: This could be easily rewritten in pure Go
Expand Down
3 changes: 2 additions & 1 deletion reflink_copy_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package docker

import (
Expand Down
2 changes: 2 additions & 0 deletions utils/uname_linux.go
@@ -1,3 +1,5 @@
// +build amd64

package utils

import (
Expand Down
3 changes: 2 additions & 1 deletion utils/uname_unsupported.go
@@ -1,4 +1,5 @@
// +build: !linux !amd64
// +build !linux !amd64

package utils

import (
Expand Down

0 comments on commit ff64093

Please sign in to comment.