mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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
5 changed files with 19 additions and 2 deletions
|
@ -84,7 +84,8 @@ fi
|
|||
# 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_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=
|
||||
if \
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
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"
|
||||
|
|
|
@ -18,6 +18,7 @@ for platform in $DOCKER_CROSSPLATFORMS; do
|
|||
export GOOS=${platform%/*}
|
||||
export GOARCH=${platform##*/}
|
||||
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"
|
||||
)
|
||||
done
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build apparmor
|
||||
|
||||
package apparmor
|
||||
|
||||
// #cgo LDFLAGS: -lapparmor
|
||||
|
|
13
pkg/libcontainer/apparmor/apparmor_disabled.go
Normal file
13
pkg/libcontainer/apparmor/apparmor_disabled.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
// +build !apparmor
|
||||
|
||||
package apparmor
|
||||
|
||||
import ()
|
||||
|
||||
func IsEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func ApplyProfile(pid int, name string) error {
|
||||
return nil
|
||||
}
|
Loading…
Add table
Reference in a new issue