Skip to content

Instantly share code, notes, and snippets.

@ipmb
Created July 6, 2015 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipmb/6451ef128f1b6f848b7c to your computer and use it in GitHub Desktop.
Save ipmb/6451ef128f1b6f848b7c to your computer and use it in GitHub Desktop.

Build a Heka RPM

# Build the image
docker build -t heka-rpm .
# Create the container
docker run --name=heka-rpm heka-rpm:latest
# Copy the rpm out of the container
docker cp heka-rpm:/heka/build/heka-0_9_3-linux-amd64.rpm .
FROM centos:7
ENV VERSION versions/0.9
ENV GO_VERSION 1.4.2
ENV CMAKE_VERSION 3.2.3
ENV PATH=/go/bin:$PATH
ENV GOROOT=/go
RUN yum install -y git gcc make rpmdevtools mercurial
RUN curl -sO https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz && \
tar xvzf go${GO_VERSION}.linux-amd64.tar.gz
RUN curl -sO http://www.cmake.org/files/v3.2/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \
tar xvzf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -C /usr/local --strip-components=1
RUN git clone https://github.com/mozilla-services/heka.git
WORKDIR /heka
RUN git checkout $VERSION && \
/bin/bash -c "source build.sh && make package"
CMD cd build && pwd && md5sum heka-*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment