From d1fe3e57284dd2583da492071e4a7739ef9795fa Mon Sep 17 00:00:00 2001 From: Jacob Blain Christen Date: Wed, 20 May 2020 18:44:36 -0700 Subject: [PATCH] build: adjust to using netcgo as k3s does --- Dockerfile | 4 ++-- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c522ba..722ca39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,8 +90,8 @@ ARG GOPATH=/go ARG CONTAINERD_VERSION="v1.3.4+k3c.1" ARG CONTAINERD_PACKAGE=github.com/dweomer/containerd ARG CONTAINERD_BUILDTAGS="apparmor seccomp selinux netgo osusergo static_build no_btrfs" -ARG CONTAINERD_EXTRA_FLAGS="-buildmode pie" -ARG CONTAINERD_EXTRA_LDFLAGS='-w -s -extldflags "-fno-PIC -static"' +ARG CONTAINERD_EXTRA_FLAGS="-buildmode=pie" +ARG CONTAINERD_EXTRA_LDFLAGS='-w -s -extldflags "-fpic -static"' RUN git clone -b "${CONTAINERD_VERSION}" "https://${CONTAINERD_PACKAGE}.git" ${GOPATH}/src/github.com/containerd/containerd WORKDIR ${GOPATH}/src/github.com/containerd/containerd ENV GO111MODULE=off diff --git a/Makefile b/Makefile index 2aa550d..dfabf0f 100644 --- a/Makefile +++ b/Makefile @@ -68,13 +68,13 @@ endif ifdef BUILDTAGS GO_BUILDTAGS = ${BUILDTAGS} else - GO_BUILDTAGS = apparmor seccomp selinux netgo osusergo static_build no_btrfs + GO_BUILDTAGS = apparmor seccomp selinux netcgo osusergo static_build no_btrfs endif GO_BUILDTAGS += ${DEBUG_TAGS} GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)",) GO_BUILDFLAGS ?= -buildmode=pie -GO_EXTLDFLAGS ?= -fno-PIC -static +GO_EXTLDFLAGS ?= -static GO_LDFLAGS ?= $(EXTRA_LDFLAGS) GO_LDFLAGS += -X ${PKG}/pkg/version.Version=$(VERSION) GO_LDFLAGS += -X ${PKG}/pkg/version.GitCommit=$(REVISION)