]> source.dussan.org Git - gitea.git/commitdiff
Add information on how to build statically (#14594)
authorzeripath <art27@cantab.net>
Mon, 8 Feb 2021 02:06:21 +0000 (02:06 +0000)
committerGitHub <noreply@github.com>
Mon, 8 Feb 2021 02:06:21 +0000 (10:06 +0800)
Fix #14576

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
docs/content/doc/installation/from-source.en-us.md

index bff206a86213d7c48b3492793d89871b12f99a1f..5525faf3d574f143fdce44adaa6a73e2b9a625e3 100644 (file)
@@ -186,3 +186,11 @@ CC=aarch64-unknown-linux-gnu-gcc GOOS=linux GOARCH=arm64 TAGS="bindata sqlite sq
 ```
 
 Replace `CC`, `GOOS`, and `GOARCH` as appropriate for your architecture target.
+
+You will sometimes need to build a static compiled image. To do this you will need to add:
+
+```
+LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="netgo osusergo $TAGS" make build
+```
+
+This can be combined with `CC`, `GOOS`, and `GOARCH` as above.