Created
March 27, 2014 09:42
-
-
Save garthk/9803867 to your computer and use it in GitHub Desktop.
Builds a .deb file for logstash-forwarder under Docker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# logstash-forwarder debian build container | |
# | |
# usage: | |
# | |
# * copy this file into your logstash-forwarder checkout directory, then: | |
# * docker build -rm -t=lsfbuild . | |
# * docker run -rm -in lsfbuild ./tarout | tar xvf - | |
# | |
# result: logstash-forwarder_*.deb et al in your checkout directory without | |
# needing to have Ruby, GCC, or Go installed. | |
FROM ubuntu:precise | |
MAINTAINER Garth Kidd <[email protected]> | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV GOTAR go1.2.1.linux-amd64.tar.gz | |
RUN apt-get update | |
RUN apt-get install -y ruby rubygems build-essential curl | |
RUN gem install --no-rdoc --no-ri fpm | |
RUN cd /tmp ; curl -OL https://go.googlecode.com/files/${GOTAR} | |
RUN cd /usr/local ; tar xfz /tmp/${GOTAR} | |
ENV PATH /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/go/bin | |
ADD . /usr/local/src/logstash-forwarder | |
WORKDIR /usr/local/src/logstash-forwarder | |
RUN go build | |
RUN rm -f *.deb | |
RUN make deb | |
# exfiltrating via tar works despite boot2docker: | |
RUN echo '#!/bin/sh' > tarout | |
RUN echo 'tar cf - logstash-forwarder_*.deb' >> tarout | |
RUN chmod a+x tarout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@garthk Thanks for the link, wasn't aware of this repo.