Skip to content

Instantly share code, notes, and snippets.

@erikh
Created July 19, 2017 22:24
Show Gist options
  • Save erikh/b5acaf1ea9bd2a25817c09524944d4b9 to your computer and use it in GitHub Desktop.
Save erikh/b5acaf1ea9bd2a25817c09524944d4b9 to your computer and use it in GitHub Desktop.
from "centos:7.3.1611"
ROOT = "/hack/saratk/nic"
env GOROOT: "/usr/local/bin/go",
GOPATH: "/go",
PATH: "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/go/bin:/go/bin"
run "yum install -y gcc gcc-c++ wget autoconf automake libtool curl make g++ unzip pkg-config"
# install protoc
run <<-EOF
set -e
wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
unzip protoc-3.3.0-linux-x86_64.zip -d protoc-dir
mv protoc-dir/bin/protoc /usr/bin/protoc
EOF
run <<-EOF
set -e
wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
tar xvzf protobuf-cpp-3.3.0.tar.gz
cd protobuf-3.3.0
./autogen.sh
./configure
make
make check
make install
EOF
run <<-EOF
set -e
git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc
cd grpc
git submodule update --init
make
make install
EOF
run <<-EOF
set -e
wget https://github.com/protobuf-c/protobuf-c/releases/download/v1.2.1/protobuf-c-1.2.1.tar.gz
tar -xvzf protobuf-c-1.2.1.tar.gz
cd protobuf-c-1.2.1
./configure && make && make install
EOF
run <<-EOF
set -e
wget https://github.com/grpc/grpc-go/archive/v1.4.2.tar.gz
tar -xvzf v1.4.2.tar.gz
cd grpc-go-1.4.2
EOF
run "curl -sSL https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz | tar xzv -C /usr/local"
__END__
PACKAGES = %w[
build-essential
autoconf
libtool
libgflags-dev
libgtest-dev
clang
libc++-dev
protobuf-compiler
protobuf-c-compiler
libboost-dev
git
curl
pkg-config
cmake
]
run "apt-get update"
run "apt-get install #{PACKAGES.join(" ")} -y"
run "git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc"
inside "/grpc" do
run "git submodule update --init"
run "make"
run "make install"
end
copy ".", ROOT, ignore_list: %w[box.rb .git gen]
workdir ROOT
run "mkdir gen"
entrypoint []
cmd "bash"
tag "pensando/nic:dependencies"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment