Giter Club home page Giter Club logo

Comments (2)

ericslandry avatar ericslandry commented on September 28, 2024

I got it to work by following dockbeat pattern and adding 2 files - Dockerfile and elasticbeat-docker.yml. Not sure how to do a clean PR cause of docker namespacing issues, but here's the quick and dirty (I'm sure these files could be cleaned up a lot).

Dockerfile:

FROM golang:1.7

# install pyyaml
RUN cd /tmp && wget http://pyyaml.org/download/pyyaml/PyYAML-3.11.tar.gz && tar -zxvf PyYAML-3.11.tar.gz
RUN cd /tmp/PyYAML-3.11 && python setup.py install
# install glide
RUN go get github.com/Masterminds/glide

COPY . $GOPATH/src/github.com/radoondas/elasticbeat
RUN cd $GOPATH/src/github.com/radoondas/elasticbeat && make && make

RUN mkdir -p /etc/elasticbeat/ \
    && cp $GOPATH/src/github.com/radoondas/elasticbeat/elasticbeat /usr/local/bin/elasticbeat \
    && cp $GOPATH/src/github.com/radoondas/elasticbeat/elasticbeat-docker.yml /etc/elasticbeat/elasticbeat.yml \
    && cp $GOPATH/src/github.com/radoondas/elasticbeat/etc/elasticbeat.template.json /etc/elasticbeat/

WORKDIR /etc/elasticbeat
ENTRYPOINT elasticbeat

CMD [ "-c", "elasticbeat.yml", "-e" ]

elasticbeat-docker.yml

input:
  period: ${ELASTICBEAT_PERIOD:10} 
  urls:
    - http://${ELASTICBEAT_URL:127.0.0.1:9200}
  stats:
    cluster: ${ELASTICBEAT_CLUSTER:true}
    nodes: ${ELASTICBEAT_NODES:true}
    health: ${ELASTICBEAT_HEALTH:true}
output:
  elasticsearch:
    hosts: ["${ELASTICBEAT_URL:localhost:9200}"]
    template:
      name: "elasticbeat"
      path: "elasticbeat.template.json"
      overwrite: false
shipper:
logging:
  files:
    rotateeverybytes: 10485760 # = 10MB

Then a few docker cmds:

  • docker build -t elasticbeat .
  • docker run -e ELASTICBEAT_URL='192.168.1.2:9200' elasticbeat

from elasticbeat.

radoondas avatar radoondas commented on September 28, 2024

Thanks @ericslandry !
I am about to play with docker and your input will be very helpful.

from elasticbeat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.