summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-02-08 02:06:21 +0000
committerGitHub <noreply@github.com>2021-02-08 10:06:21 +0800
commit98827e99f63178c43187e686ffc4bf03d9d18d36 (patch)
treefd1560c399c78004d2183a2b3c027b2ed326f4df
parentf1800093754849b676df82fc204fe7b9bca4da2a (diff)
downloadgitea-98827e99f63178c43187e686ffc4bf03d9d18d36.tar.gz
gitea-98827e99f63178c43187e686ffc4bf03d9d18d36.zip
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>
-rw-r--r--docs/content/doc/installation/from-source.en-us.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md
index bff206a862..5525faf3d5 100644
--- a/docs/content/doc/installation/from-source.en-us.md
+++ b/docs/content/doc/installation/from-source.en-us.md
@@ -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.