mirror of https://github.com/docker/docs.git
Add buildflags to allow crosscompilation for apparmor
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
This commit is contained in:
parent
f0f833c6d7
commit
c89fa6645e
|
@ -84,7 +84,8 @@ fi
|
||||||
# Use these flags when compiling the tests and final binary
|
# Use these flags when compiling the tests and final binary
|
||||||
LDFLAGS='-X github.com/dotcloud/docker/dockerversion.GITCOMMIT "'$GITCOMMIT'" -X github.com/dotcloud/docker/dockerversion.VERSION "'$VERSION'" -w'
|
LDFLAGS='-X github.com/dotcloud/docker/dockerversion.GITCOMMIT "'$GITCOMMIT'" -X github.com/dotcloud/docker/dockerversion.VERSION "'$VERSION'" -w'
|
||||||
LDFLAGS_STATIC='-X github.com/dotcloud/docker/dockerversion.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'
|
LDFLAGS_STATIC='-X github.com/dotcloud/docker/dockerversion.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'
|
||||||
BUILDFLAGS='-tags netgo -a'
|
BUILDFLAGS='-a'
|
||||||
|
BUILDTAGS="apparmor netgo"
|
||||||
|
|
||||||
HAVE_GO_TEST_COVER=
|
HAVE_GO_TEST_COVER=
|
||||||
if \
|
if \
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
DEST=$1
|
DEST=$1
|
||||||
|
|
||||||
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS $LDFLAGS_STATIC" $BUILDFLAGS ./docker
|
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS $LDFLAGS_STATIC" $BUILDFLAGS -tags "$BUILDTAGS" ./docker
|
||||||
echo "Created binary: $DEST/docker-$VERSION"
|
echo "Created binary: $DEST/docker-$VERSION"
|
||||||
|
|
|
@ -18,6 +18,7 @@ for platform in $DOCKER_CROSSPLATFORMS; do
|
||||||
export GOOS=${platform%/*}
|
export GOOS=${platform%/*}
|
||||||
export GOARCH=${platform##*/}
|
export GOARCH=${platform##*/}
|
||||||
export LDFLAGS_STATIC="" # we just need a simple client for these platforms (TODO this might change someday)
|
export LDFLAGS_STATIC="" # we just need a simple client for these platforms (TODO this might change someday)
|
||||||
|
export BUILDTAGS="netgo"
|
||||||
source "$(dirname "$BASH_SOURCE")/binary" "$DEST/$platform"
|
source "$(dirname "$BASH_SOURCE")/binary" "$DEST/$platform"
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build apparmor
|
||||||
|
|
||||||
package apparmor
|
package apparmor
|
||||||
|
|
||||||
// #cgo LDFLAGS: -lapparmor
|
// #cgo LDFLAGS: -lapparmor
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// +build !apparmor
|
||||||
|
|
||||||
|
package apparmor
|
||||||
|
|
||||||
|
import ()
|
||||||
|
|
||||||
|
func IsEnabled() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func ApplyProfile(pid int, name string) error {
|
||||||
|
return nil
|
||||||
|
}
|
Loading…
Reference in New Issue