Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit 23de3ec

Browse files
authored
Merge pull request #55 from dweomer/static-build
build: adjust to using netcgo as k3s does
2 parents 18e5fb5 + d1fe3e5 commit 23de3ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ ARG GOPATH=/go
9090
ARG CONTAINERD_VERSION="v1.3.4+k3c.1"
9191
ARG CONTAINERD_PACKAGE=github.com/dweomer/containerd
9292
ARG CONTAINERD_BUILDTAGS="apparmor seccomp selinux netgo osusergo static_build no_btrfs"
93-
ARG CONTAINERD_EXTRA_FLAGS="-buildmode pie"
94-
ARG CONTAINERD_EXTRA_LDFLAGS='-w -s -extldflags "-fno-PIC -static"'
93+
ARG CONTAINERD_EXTRA_FLAGS="-buildmode=pie"
94+
ARG CONTAINERD_EXTRA_LDFLAGS='-w -s -extldflags "-fpic -static"'
9595
RUN git clone -b "${CONTAINERD_VERSION}" "https://${CONTAINERD_PACKAGE}.git" ${GOPATH}/src/github.com/containerd/containerd
9696
WORKDIR ${GOPATH}/src/github.com/containerd/containerd
9797
ENV GO111MODULE=off

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ endif
6868
ifdef BUILDTAGS
6969
GO_BUILDTAGS = ${BUILDTAGS}
7070
else
71-
GO_BUILDTAGS = apparmor seccomp selinux netgo osusergo static_build no_btrfs
71+
GO_BUILDTAGS = apparmor seccomp selinux netcgo osusergo static_build no_btrfs
7272
endif
7373
GO_BUILDTAGS += ${DEBUG_TAGS}
7474
GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)",)
7575

7676
GO_BUILDFLAGS ?= -buildmode=pie
77-
GO_EXTLDFLAGS ?= -fno-PIC -static
77+
GO_EXTLDFLAGS ?= -static
7878
GO_LDFLAGS ?= $(EXTRA_LDFLAGS)
7979
GO_LDFLAGS += -X ${PKG}/pkg/version.Version=$(VERSION)
8080
GO_LDFLAGS += -X ${PKG}/pkg/version.GitCommit=$(REVISION)

0 commit comments

Comments
 (0)