docs: 优化 readme 编译指引

This commit is contained in:
Mmx233
2023-02-19 14:05:04 +08:00
parent fdda816456
commit 8a2adbf10f

View File

@@ -86,11 +86,11 @@ settings:
镜像:`mmx233/bitsrunlogin-go:latest` 镜像:`mmx233/bitsrunlogin-go:latest`
支持 linux/amd64、linux/386、linux/arm64、linux/arm/v7 架构windows 的 WSL2 版 docker 也算 Linux 支持 linux/amd64、linux/386、linux/arm64、linux/arm/v7 架构
直接使用: 直接使用:
配置文件挂载至 `/data/Config.yaml`,若需更改配置文件类型,可以使用 --entrypoint 覆写启动参数 配置文件挂载至 `/data/Config.yaml`,若需更改配置文件类型,可以使用 `--entrypoint` 覆写启动参数
```shell ```shell
docker run -v path_to_config:/data/Config.yaml mmx233/bitsrunlogin-go:latest docker run -v path_to_config:/data/Config.yaml mmx233/bitsrunlogin-go:latest
@@ -110,18 +110,15 @@ docker build . --file Dockerfile --tag mmx233/bitsrunlogin-go:latest
请安装最新版 golang 请安装最新版 golang
直接编译本系统可执行程序:
```shell ```shell
#直接编译本系统可执行程序:
git clone https://github.com/Mmx233/BitSrunLoginGo.git git clone https://github.com/Mmx233/BitSrunLoginGo.git
cd BitSrunLoginGo cd BitSrunLoginGo
go build go build
```
或者使用经过优化的构建命令: #或者使用经过优化的构建命令:
```shell
go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-s -w -extldflags '-static'" go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-s -w -extldflags '-static'"
``` ```
交叉编译Linux 交叉编译Linux
@@ -139,7 +136,7 @@ go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-s -w
$env:GOGGC=0 $env:GOGGC=0
$env:GOOS='linux' #系统 $env:GOOS='linux' #系统
$env:GOARCH='amd64' #架构 $env:GOARCH='amd64' #架构
go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-s -w -extldflags '-static'" go build -gcflags=-trimpath=$env:GOPATH -asmflags=-trimpath=$env:GOPATH -ldflags "-s -w -extldflags '-static'"
``` ```
golang 支持的系统与架构请自行查询 golang 支持的系统与架构请自行查询