Skip to content

Instantly share code, notes, and snippets.

@mrbuk
Last active June 27, 2016 09:27
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 mrbuk/8b0bb7a34391c8f67ce90c23db631b00 to your computer and use it in GitHub Desktop.
Save mrbuk/8b0bb7a34391c8f67ce90c23db631b00 to your computer and use it in GitHub Desktop.
firehose-to-syslog build env
#!/bin/bash
# Setup repo
go get -v github.com/cloudfoundry-community/firehose-to-syslog
cd $GOPATH/src/github.com/cloudfoundry-community/firehose-to-syslog
git checkout tags/1.6.0
# Test
ginkgo -r .
# Build binary
godep go build
FROM centos:centos6
# install epel for new git version
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# golang dependencies: gcc for cgo
RUN yum -y update && yum -y install \
g++ \
gcc \
libc6-dev \
make
# git dependencies
RUN yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
# clean packages
RUN yum -y clean packages
ENV GIT_VERSION 2.9.0
ENV GIT_DOWNLOAD_URL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz
ENV GIT_DOWNLOAD_SHA256 bff7560f5602fcd8e37669e0f65ef08c6edc996e4f324e4ed6bb8a84765e30bd
# install git
RUN curl -fsSL "$GIT_DOWNLOAD_URL" -o git.tar.gz \
&& echo "$GIT_DOWNLOAD_SHA256 git.tar.gz" | sha256sum -c - \
&& tar -C /usr/src -xzf git.tar.gz \
&& pushd /usr/src/git-${GIT_VERSION} \
&& make prefix=/usr/local/git all \
&& make prefix=/usr/local/git install \
&& rm -rf /usr/local/git-${GIT_VERSION} \
&& popd \
&& rm git.tar.gz
ENV PATH /usr/local/git/bin:$PATH
# install golang
ENV GOLANG_VERSION 1.6.2
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
RUN go get github.com/tools/godep \
&& go get github.com/onsi/ginkgo/ginkgo \
&& go get github.com/onsi/gomega
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment