Skip to content

Instantly share code, notes, and snippets.

@garthk
Created March 27, 2014 09:42
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 garthk/9803867 to your computer and use it in GitHub Desktop.
Save garthk/9803867 to your computer and use it in GitHub Desktop.
Builds a .deb file for logstash-forwarder under Docker.
# 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 <garth@garthk.com>
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
@garthk
Copy link
Author

garthk commented Mar 27, 2014

Or, just use the APT repo at: deb http://packages.elasticsearch.org/logstashforwarder/debian stable main

@0xqd
Copy link

0xqd commented Apr 29, 2014

@garthk: thanks for your comment. I've been looking for this since it's not available on their homepage :)

@metahertz
Copy link

@garthk Thanks for the link, wasn't aware of this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment