add more build from source details

This commit is contained in:
c9s 2021-12-08 23:36:49 +08:00
parent a0f46bf9b8
commit a540968533

View File

@ -1,5 +1,7 @@
# Build From Source # Build From Source
## Install Go SDK
Go to the Go official website to download the Go SDK <https://go.dev/dl/>. Go to the Go official website to download the Go SDK <https://go.dev/dl/>.
An example installation looks like this: An example installation looks like this:
@ -28,12 +30,18 @@ Make sure your `go` is successfully installed:
go version go version
``` ```
## Install go-sqlite
If you need to use go-sqlite, you will need to enable CGO first: If you need to use go-sqlite, you will need to enable CGO first:
``` ```
CGO_ENABLED=1 go get github.com/mattn/go-sqlite3 CGO_ENABLED=1 go get github.com/mattn/go-sqlite3
``` ```
## Install
### Install bbgo via go install
Install bbgo: Install bbgo:
```sh ```sh
@ -64,6 +72,34 @@ export GOPATH=~/mygo
Then your bbgo will be installed at `~/mygo/bin/bbgo`. Then your bbgo will be installed at `~/mygo/bin/bbgo`.
### Install via git clone
```shell
mkdir -p ~/go/src/github.com/c9s
git clone git@github.com:c9s/bbgo.git ~/go/src/github.com/c9s/bbgo
cd ~/go/src/github.com/c9s/bbgo
go mod download
```
And then you should be able to run bbgo with `go run`
```shell
go run ./cmd/bbgo run
```
You can also use the makefile to build bbgo:
```shell
cd frontend && yarn install
make bbgo
```
If you don't need the web interface, you can build the slim version of bbgo:
```shell
make bbgo-slim
```
## Build inside a Alpine container ## Build inside a Alpine container
Starts a docker container with the alpine image: Starts a docker container with the alpine image: