Skip to content

Commit

Permalink
add build instructions
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Jeffery <[email protected]>
  • Loading branch information
Mitchell Thomas authored and travisjeffery committed Apr 3, 2018
1 parent f5d7996 commit 122387a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM golang:1.9-alpine
FROM golang:1.9-alpine as build-base
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh make && \
go get -u github.com/golang/dep/cmd/dep
ADD . /go/src/github.com/travisjeffery/jocko
WORKDIR /go/src/github.com/travisjeffery/jocko
RUN GOOS=linux GOARCH=amd64 make deps build
RUN GOOS=linux GOARCH=amd64 make build

FROM alpine:latest
COPY --from=0 /go/src/github.com/travisjeffery/jocko/jocko /usr/local/bin/jocko
COPY --from=build-base /go/src/github.com/travisjeffery/jocko/cmd/jocko/jocko /usr/local/bin/jocko
EXPOSE 9092 9093 9094 9095
VOLUME "/tmp/jocko"
CMD ["jocko"]
CMD ["jocko", "broker"]
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
BUILD_PATH := jocko
BUILD_PATH := cmd/jocko/jocko
DOCKER_TAG := latest

all: deps test
all: test

deps:
@which dep 2>/dev/null || go get -u github.com/golang/dep/cmd/dep
@dep ensure
@dep ensure -v

vet:
@go list ./... | grep -v vendor | xargs go vet

build:
build: deps
@go build -o $(BUILD_PATH) cmd/jocko/main.go

release:
Expand All @@ -26,7 +26,7 @@ build-docker:
generate:
@go generate

test:
test: build
@go test -v ./...

test-race:
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ Kafka/distributed commit log service in Go.
└── mock mocks of the various subsystems
```

## Building the Docker image

`docker build -t travisjeffery/jocko:latest .`


## Building locally

1. Clone Jocko

`git clone github.com/travisjeffery/jocko $GOPATH/src/github.com/travisjeffery/jocko`

1. Build Jocko

`cd $GOPATH/src/github.com/travisjeffery/jocko; make`


## License

MIT
Expand All @@ -64,4 +80,5 @@ MIT
- [travisjeffery.com](http://travisjeffery.com)
- GitHub [@travisjeffery](https://github.com/travisjeffery)
- Twitter [@travisjeffery](https://twitter.com/travisjeffery)

- Medium [@travisjeffery](https://medium.com/@travisjeffery)

0 comments on commit 122387a

Please sign in to comment.