Skip to content

Commit

Permalink
static: update BUILDTAGS
Browse files Browse the repository at this point in the history
Some build tags are no longer needed; updating them to match the
recommendations from the upstream repositories.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed May 4, 2022
1 parent 46b2568 commit 15c513c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions scripts/build-static
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ mkdir -p "${DEST_DIR}"
# Build containerd
(
set -x
export BUILDTAGS='netgo osusergo static_build seccomp apparmor selinux'
# see https://github.com/containerd/containerd/blob/main/BUILDING.md#static-binaries
export EXTRA_FLAGS='-buildmode=pie'
export EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"'
export EXTRA_LDFLAGS='-linkmode external -extldflags "-fno-PIC -static"'
export BUILDTAGS='netgo osusergo static_build'

case "${ID}" in
centos|ol|rhel)
BUILDTAGS='netgo osusergo static_build apparmor selinux no_btrfs'
export BUILDTAGS="$BUILDTAGS no_btrfs"
;;
esac

Expand All @@ -50,7 +51,6 @@ mkdir -p "${DEST_DIR}"
# Build runc
(
set -x
RUNC_BUILDTAGS="seccomp apparmor selinux"

case "${ID}" in
fedora)
Expand All @@ -65,12 +65,9 @@ mkdir -p "${DEST_DIR}"
# make: Leaving directory '/go/src/github.com/opencontainers/runc'
dnf -y install libseccomp-static
;;
centos|ol|rhel)
RUNC_BUILDTAGS="apparmor selinux"
;;
esac

make -C "/go/src/github.com/opencontainers/runc" BUILDTAGS="${RUNC_BUILDTAGS}" static
make -C "/go/src/github.com/opencontainers/runc" static
install -D -p -t "${DEST_DIR}/bin" "/go/src/github.com/opencontainers/runc/runc"
)

Expand Down

0 comments on commit 15c513c

Please sign in to comment.