Skip to content

Commit

Permalink
Added Dockerfile and Docker-compose to project
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmchan committed May 23, 2016
1 parent ec4d909 commit cdc1c71
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Burrow
!config
log
.idea
Burrow.iml
Burrow.iml
tmp
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:alpine

MAINTAINER LinkedIn Burrow "https://github.com/linkedin/Burrow"

RUN apk add --update bash curl git && rm -rf /var/cache/apk/*

RUN wget https://raw.githubusercontent.com/pote/gpm/v1.4.0/bin/gpm && chmod +x gpm && mv gpm /usr/local/bin

ADD . $GOPATH/src/github.com/linkedin/burrow
RUN cd $GOPATH/src/github.com/linkedin/burrow && gpm install && go install

ADD docker-config /etc/burrow

WORKDIR /var/tmp/burrow

CMD ["/go/bin/burrow", "--config", "/etc/burrow/burrow.cfg"]
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ $ go install
$ $GOPATH/bin/burrow --config path/to/burrow.cfg
```

### Using Docker
A Docker file is available which builds this project on top of an Alpine Linux image.
To use it, build your docker container, mount your Burrow configuration into `/etc/burrow` and run docker.

A [Docker Compose](https://docs.docker.com/compose/) is also available for quick and easy development.

Install Docker Compose and then:

1. Build the docker container:
```
docker-compose build
```

2. Run the docker compose stack which includes kafka and zookeeper:
```
docker-compose down; docker-compose up
```

3. Some test topics have already been created by default and Burrow can be accessed on port 8000 of your docker-machine. e.g. `http://192.168.99.100:8000/v2/kafka`

### Configuration
For information on how to write your configuration file, check out the [detailed wiki](https://github.com/linkedin/Burrow/wiki)

Expand Down
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
services:
burrow:
build: .
volumes:
- ${PWD}/docker-config:/etc/burrow/
- ${PWD}/tmp:/var/tmp/burrow
ports:
- 8000:8000
depends_on:
- zookeeper
- kafka
restart: always

zookeeper:
image: wurstmeister/zookeeper
ports:
- 2181:2181

kafka:
image: wurstmeister/kafka
ports:
- 9092:9092
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181/local
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ADVERTISED_PORT: 9092
KAFKA_CREATE_TOPICS: "test-topic:2:1,test-topic2:1:1,test-topic3:1:1"
29 changes: 29 additions & 0 deletions docker-config/burrow.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[general]
logconfig=/etc/burrow/logging.cfg
group-blacklist=^(console-consumer-|python-kafka-consumer-).*$

[zookeeper]
hostname=zookeeper
port=2181
timeout=6
lock-path=/burrow/notifier

[kafka "local"]
broker=kafka
broker-port=9092
offsets-topic=__consumer_offsets
zookeeper=zookeeper
zookeeper-path=/local
zookeeper-offsets=true
offsets-topic=__consumer_offsets

[tickers]
broker-offsets=60

[lagcheck]
intervals=10
expire-group=604800

[httpserver]
server=on
port=8000
8 changes: 8 additions & 0 deletions docker-config/logging.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<seelog minlevel="debug">
<outputs formatid="main">
<rollingfile type="date" filename="/var/tmp/burrow/burrow.log" datepattern="2006-01-02" maxrolls="7" />
</outputs>
<formats>
<format id="main" format="%Date(2006-01-02 15:04:05) [%LEVEL] %Msg%n"/>
</formats>
</seelog>

0 comments on commit cdc1c71

Please sign in to comment.