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

Commit

Permalink
Merge pull request #55 from dweomer/static-build
Browse files Browse the repository at this point in the history
build: adjust to using netcgo as k3s does
  • Loading branch information
dweomer authored May 21, 2020
2 parents 18e5fb5 + d1fe3e5 commit 23de3ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 23de3ec

Please sign in to comment.