Merge pull request #1824 from kolyshkin/static-build

plugins: don't compile for static build
This commit is contained in:
Michael Crosby
2017-11-29 10:27:06 -05:00
committed by GitHub
3 changed files with 16 additions and 2 deletions

View File

@@ -43,6 +43,20 @@ You can move them in your global path with:
sudo make install
```
### Static binaries
You can build static binaries by providing a few variables to `make`:
```sudo
make EXTRA_FLAGS="-buildmode pie" \
EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' \
BUILDTAGS="static_build"
```
Note that
- static build is discouraged
- static containerd binary does not support plugins loading
## Via Docker Container
### Build containerd

View File

@@ -1,4 +1,4 @@
// +build go1.8,!windows,amd64
// +build go1.8,!windows,amd64,!static_build
package plugin

View File

@@ -1,4 +1,4 @@
// +build !go1.8 windows !amd64
// +build !go1.8 windows !amd64 static_build
package plugin