Skip to content

Instantly share code, notes, and snippets.

@mindscratch
Last active February 13, 2019 18:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mindscratch/0cee6d51ddee893fc2fb432f7aba5796 to your computer and use it in GitHub Desktop.
Save mindscratch/0cee6d51ddee893fc2fb432f7aba5796 to your computer and use it in GitHub Desktop.
Build Thrift Binary on CentOS 7

To build the thrift binary, we'll use the CentOS 7 docker image provided by the Thrift project.

Below are the basic steps:

  1. get the dockerfile
  2. get thrift tarball
  3. extract tarball
  4. build thrift
make get_dockerfile build_image
make get_thrift extract_thrift

# this step puts you inside the container, ready to build thrift
make build_thrift

# once in the container, run configure, make and make install, for example:
./configure --without-ruby --without-d --without-dart --without-haskell --without-erlang --without-nodejs --without-ocaml --without-php --without-lua --without-perl --without-rust
make
make install
# copy the thrift binary to a directory that'll exist outside the container once you exit
cp /usr/local/bin/thrift .
THRIFT_VERSION=0.11.0
get_dockerfile:
@wget https://raw.githubusercontent.com/apache/thrift/master/build/docker/centos-7.3/Dockerfile
build_image:
@docker build -t thrift .
get_thrift:
@wget http://mirrors.ibiblio.org/apache/thrift/$(THRIFT_VERSION)/thrift-$(THRIFT_VERSION).tar.gz
extract_thrift:
@tar xzf thrift-$(THRIFT_VERSION).tar.gz
build_thrift:
@docker run -v $(PWD)/thrift-$(THRIFT_VERSION):/thrift/src/ -it thrift bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment