Skip to content

Commit 48be188

Browse files
lunnytechknowlogick
authored andcommitted
Fix latest docker image haven't include static files. (#9252)
* add warnging on docs * fix docs
1 parent d9c67a8 commit 48be188

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
1919

2020
#Checkout version if set
2121
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
22-
&& make clean generate build
22+
&& make clean build
2323

2424
FROM alpine:3.10
2525
LABEL maintainer="[email protected]"

docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ docker:
1111

1212
.PHONY: docker-build
1313
docker-build:
14-
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" webhippie/golang:edge make clean generate build
14+
docker run -ti --rm -v $(CURDIR):/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" webhippie/golang:edge make clean build

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ To include assets, add the `bindata` tag:
106106
TAGS="bindata" make build
107107
```
108108

109+
WARNING: `generate` method is deprecated and using it may cause build to miss some static files.
110+
109111
In the default release build of our continuous integration system, the build
110112
tags are: `TAGS="bindata sqlite sqlite_unlock_notify"`. The simplest
111113
recommended way to build from source is therefore:

docs/content/doc/installation/from-source.zh-cn.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,34 @@ git checkout v{{< version >}}
4444

4545
## 编译
4646

47-
我们已经将所有的依赖项拷贝到本工程,我们提供了一些 [编译选项](https://github.com/go-gitea/gitea/blob/master/Makefile) 来让编译更简单。你可以按照你的需求来设置编译开关,可用编译选项如下
47+
要从源代码进行编译,以下依赖程序必须事先安装好
4848

49-
* `bindata`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。
50-
* `sqlite sqlite_unlock_notify`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。
51-
* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。
49+
- `go` 1.11.0 或以上版本, 详见 [here](https://golang.org/dl/)
50+
- `node` 10.0.0 或以上版本,并且安装 `npm`, 详见 [here](https://nodejs.org/en/download/)
51+
- `make`, 详见 <a href='{{< relref "make.zh-cn.md" >}}'>这里</a>
5252

53-
我们支持两种方式进行编译,Make 工具 和 Go 工具。不过我们推荐使用 Make工具,因为他将会给出更多的编译选项。
53+
各种可用的 [make 任务](https://github.com/go-gitea/gitea/blob/master/Makefile)
54+
可以用来使编译过程更方便。
5455

55-
**Note**: We recommend the Go version 1.6 or higher because we are using vendoring and we don't set the required env variable for 1.5 anywhere.
56+
按照您的编译需求,以下 tags 可以使用:
5657

57-
* Make 工具
58+
* `bindata`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。
59+
* `sqlite sqlite_unlock_notify`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。
60+
* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。
5861

59-
这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate:
62+
使用 bindata 可以打包资源文件到二进制可以使开发和测试更容易,你可以根据自己的需求决定是否打包资源文件。
63+
要包含资源文件,请使用 `bindata` tag:
6064

61-
```
62-
TAGS="bindata" make generate build
65+
```bash
66+
TAGS="bindata" make build
6367
```
6468

65-
* Go 工具
69+
警告: `generate` 已经废弃,使用 `generate` 会导致资源文件打包失败。
6670

67-
使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下
71+
默认的发布版本中的编译选项是: `TAGS="bindata sqlite sqlite_unlock_notify"`。以下为推荐的编译方式
6872

69-
```
70-
go build
73+
```bash
74+
TAGS="bindata sqlite sqlite_unlock_notify" make build
7175
```
7276

7377
## 测试

0 commit comments

Comments
 (0)