BUILDING.md: fix description about static builds

* `-linkmode external` is required since Go 1.15 for static builds: https://github.com/golang/go/issues/40711
* Clarify the meaning of "loading plugins"

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2020-08-12 16:24:00 +09:00
parent e9f94064b9
commit 43cbdf89e9
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A

View File

@ -117,13 +117,13 @@ You can build static binaries by providing a few variables to `make`:
```sudo
make EXTRA_FLAGS="-buildmode pie" \
EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' \
EXTRA_LDFLAGS='-linkmode external -extldflags "-fno-PIC -static"' \
BUILDTAGS="netgo osusergo static_build"
```
> *Note*:
> - static build is discouraged
> - static containerd binary does not support loading plugins
> - static containerd binary does not support loading shared object plugins (`*.so`)
# Via Docker container