Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go build use statically linked #595

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test:
GO111MODULE=on go test ./wallet

build_linux_amd64:
env GOOS=linux GO111MODULE=on GOARCH=amd64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux/gvite $(MAIN)
env GOOS=linux CGO_ENABLED=0 GO111MODULE=on GOARCH=amd64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux/gvite $(MAIN)

@cp $(shell pwd)/conf/node_config.json $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux/node_config.json
@cp $(shell pwd)/bin/bootstrap_linux $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux/bootstrap
Expand All @@ -48,7 +48,7 @@ build_linux_amd64:
@echo "Build linux version done."

build_linux_arm64:
env GOOS=linux GO111MODULE=on GOARCH=arm64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux-arm64/gvite $(MAIN)
env GOOS=linux CGO_ENABLED=0 GO111MODULE=on GOARCH=arm64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux-arm64/gvite $(MAIN)

@cp $(shell pwd)/conf/node_config.json $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux-arm64/node_config.json
@cp $(shell pwd)/bin/bootstrap_linux $(BUILD_DIR)/gvite-$(VITE_VERSION)-linux-arm64/bootstrap
Expand All @@ -57,15 +57,15 @@ build_linux_arm64:
@echo "Build linux-arm64 version done."

build_darwin:
env GOOS=darwin GO111MODULE=on GOARCH=amd64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-darwin/gvite $(MAIN)
env GOOS=darwin CGO_ENABLED=0 GO111MODULE=on GOARCH=amd64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-darwin/gvite $(MAIN)

@cp $(shell pwd)/conf/node_config.json $(BUILD_DIR)/gvite-$(VITE_VERSION)-darwin/node_config.json
@ls -d $(BUILD_DIR)/gvite-$(VITE_VERSION)-darwin/gvite
@echo "Build darwin version done"


build_windows:
env GOOS=windows GO111MODULE=on GOARCH=amd64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-windows/gvite-windows-amd64.exe $(MAIN)
env GOOS=windows CGO_ENABLED=0 GO111MODULE=on GOARCH=amd64 go build -o $(BUILD_DIR)/gvite-$(VITE_VERSION)-windows/gvite-windows-amd64.exe $(MAIN)

@cp $(shell pwd)/conf/node_config.json $(BUILD_DIR)/gvite-$(VITE_VERSION)-windows/node_config.json
@ls -d $(BUILD_DIR)/gvite-$(VITE_VERSION)-windows/gvite-windows-amd64.exe
Expand Down
8 changes: 8 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ docker build -t vitelabs/gvite:test -f docker/Dockerfile .
docker run -v $HOME/.gvite/:/root/.gvite/ -p 48132:48132 -p 41420:41420 -p 8483:8483 -p 8484:8484 -p 8483:8483/udp -d vitelabs/gvite:test
```



# quickly Build from local binary

```
gvite-linux
docker build -t vitelabs/gvite-nightly:test . -f docker/Dockerfile.preBuild
```