mirror of
https://github.com/xiaoqidun/goenv.git
synced 2024-11-22 16:16:46 +08:00
docs(更新文档): 更新文档
This commit is contained in:
parent
c8559a24ca
commit
7ee98ef20c
22
README.md
22
README.md
@ -13,17 +13,6 @@ docker pull xiaoqidun/goenv:latest
|
||||
docker run -it --rm xiaoqidun/goenv
|
||||
```
|
||||
|
||||
# 交叉编译
|
||||
> 以编译android arm64程序为例
|
||||
|
||||
```shell
|
||||
export CC=aarch64-linux-android21-clang
|
||||
export GOOS=android
|
||||
export GOARCH=arm64
|
||||
export CGO_ENABLED=1
|
||||
go build -o main_android_arm64 main.go
|
||||
```
|
||||
|
||||
# 编译项目
|
||||
|
||||
## 将项目文件映射到容器内部
|
||||
@ -45,6 +34,8 @@ docker run --rm -it -v "${pwd}:/go/src/app" -w /go/src/app xiaoqidun/goenv
|
||||
```
|
||||
|
||||
## 在容器内执行命令进行编译
|
||||
|
||||
### 编译windows程序
|
||||
```shell
|
||||
export GOOS=windows
|
||||
export GOARCH=amd64
|
||||
@ -52,6 +43,15 @@ export CGO_ENABLED=0
|
||||
go build -o main_windows_amd64.exe main.go
|
||||
```
|
||||
|
||||
### 编译android程序
|
||||
```shell
|
||||
export CC=aarch64-linux-android21-clang
|
||||
export GOOS=android
|
||||
export GOARCH=arm64
|
||||
export CGO_ENABLED=1
|
||||
go build -o main_android_arm64 main.go
|
||||
```
|
||||
|
||||
# 编译说明
|
||||
|
||||
## GOOS
|
||||
|
Loading…
x
Reference in New Issue
Block a user