consul - sinherle/Recipes GitHub Wiki
Consul Build for SLES12 & RHEL7 & Ubuntu 16.04
Install Dependencies
-
RHEL7
sudo yum install git vi gcc tar wget
-
SLES12
sudo zypper install git vi gcc tar wget
-
Ubuntu 16.04
apt-get install git golang vim gcc tar wget
-
GO >v1.5 (RHEL7 and SLES12)
Note:
GODEPS:
Consul uses [godeps](https://github.com/tools/godep] as its internal
dependencies management tool
GOX:
Gonsul uses [gox](https://github.com/mitchellh/gox) as its cross-compile tool
Building Consul from its source
-
Make directory & clone the source code
mkdir $GOPATH/src cd $GOPATH/src mkdir -p ./github.com/hashicorp cd $GOPATH/src/github.com/hashicorp git clone https://github.com/hashicorp/consul.git
-
Modify build script
cd $GOPATH/src/github.com/hashicorp/consul/scripts
-
Modify file
$GOPATH/src/github.com/hashicorp/consul/scripts/build.sh
with your choice of editorreplace line from 40 to 45 with "cd $DIR" and add "go install" to the following line
These lines invoke tool gox and compile for different ARCH and OS combos.Unfortunately, gox does not support s390x arch for now.Therefore, in order to build consul for z System, it is required to use the native build tool of go.
-
Replace sys package
cd $GOPATH/src/github.com/hashicorp/consul/vendor/golang.org/x mv sys sys.bak git clone https://github.com/linux-on-ibm-z/sys.git
-
Build consul
cd $GOPATH/src/github.com/hashicorp/consul/ make
There might be some error messages, but we can ignore them for now
-
Verify build success
cd $GOPATH/bin ./consul