https://github.com/ziozzang/go-static-template
Golang Static Binary build script templates, with docker version of golang.
https://github.com/ziozzang/go-static-template
bash-script build-script docker golang static-binary
Last synced: about 1 month ago
JSON representation
Golang Static Binary build script templates, with docker version of golang.
- Host: GitHub
- URL: https://github.com/ziozzang/go-static-template
- Owner: ziozzang
- License: mit
- Created: 2018-02-14T22:50:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-15T00:10:15.000Z (about 7 years ago)
- Last Synced: 2025-01-28T18:21:24.969Z (3 months ago)
- Topics: bash-script, build-script, docker, golang, static-binary
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-static-template
Golang Static Binary build script templates, with docker version of golang.# TL;DR
* This templates to generate linux base static binary.
* You can use any golang project with this build templates.
* This scripts are automatically download external library at github.# Pre-requisit
* docker installed.(+internet connected to download container images and external library)
* any linux or mac osx with bash installed.# how to use
1. Just copy 'make' and 'build.sh' to any golang project. or just run command
```
curl https://raw.githubusercontent.com/ziozzang/go-static-template/master/install | bash
```2. run "build.sh".
3. you can get static built binary.* if you want to build specific golang version use like this
```
GO_VERSION=1.8 ./build.sh
```* if you want to set specific binary name, use like this
```
BIN_NAME=foo ./build.sh
```* defulat golang version is latest. (docker version of golang tag)
* you can check docker tags [here](https://hub.docker.com/_/golang/)# Static binary
* you can run binary with any linux distro. like alpine, debian, ubuntu, redhat or some.# Disclaimer
* This script is for my own purpose. tested on product but no warrenty.
* This script is for generated AMD64/Linux binary.if you want to build any elas architecture, you can modify script!