Skip to content

Commit 98827e9

Browse files
zeripathlunny
andauthored
Add information on how to build statically (#14594)
Fix #14576 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent f180009 commit 98827e9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/content/doc/installation/from-source.en-us.md

+8
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,11 @@ CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sq
186186
```
187187

188188
Replace `CC`, `GOOS`, and `GOARCH` as appropriate for your architecture target.
189+
190+
You will sometimes need to build a static compiled image. To do this you will need to add:
191+
192+
```
193+
LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="netgo osusergo $TAGS" make build
194+
```
195+
196+
This can be combined with `CC`, `GOOS`, and `GOARCH` as above.

0 commit comments

Comments
 (0)