Skip to content

Commit

Permalink
include plugins in docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Aug 21, 2017
1 parent 55d5bca commit d5eaff4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ FROM golang:1.8-alpine

MAINTAINER TFG Co <backend@tfgco.com>

RUN mkdir /app
RUN mkdir -p /app/bin

RUN apk update
RUN apk add postgresql git make
RUN apk add postgresql git make musl-dev gcc
RUN go get -u github.com/jteeuwen/go-bindata/...

COPY ./bin/maestro-linux-amd64 /app/maestro
COPY ./bin/grpc.so /app/bin/grpc.so
COPY ./config/local.yaml /app/config/local.yaml
COPY ./Makefile /app/Makefile
COPY ./scripts/drop.sql /app/scripts/drop.sql
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
MY_IP=`ifconfig | grep --color=none -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep --color=none -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -n 1`
TEST_PACKAGES=`find . -type f -name "*.go" ! \( -path "*vendor*" \) | sed -En "s/([^\.])\/.*/\1/p" | uniq`

.PHONY: plugins

setup: setup-hooks
@go get -u github.com/golang/dep...
@go get -u github.com/jteeuwen/go-bindata/...
Expand All @@ -28,7 +30,7 @@ setup-ci:
build:
@mkdir -p bin && go build -o ./bin/maestro main.go

build-docker: cross-build-linux-amd64
build-docker: cross-build-linux-amd64 plugins
@docker build -t maestro .

cross-build-linux-amd64:
Expand Down Expand Up @@ -173,5 +175,8 @@ generate-proto:
@protoc -I plugins/grpc/protobuf/ plugins/grpc/protobuf/*.proto --go_out=plugins=grpc:plugins/grpc/generated
@echo 'proto files created at plugins/grpc/generated'

plugins-linux:
@go build -o grpc.so -buildmode=plugin plugins/grpc/forwarder.go

plugins:
@docker run -v $$(pwd)/eventforwarder:/go/src/github.com/topfreegames/maestro/eventforwarder -ti golang bash -c "cd /go/src/github.com/topfreegames/maestro/eventforwarder && go get github.com/golang/protobuf/protoc-gen-go google.golang.org/grpc golang.org/x/net/context && go build -buildmode=plugin"
@docker run -v $$(pwd)/:/go/src/github.com/topfreegames/maestro -ti golang bash -c "cd /go/src/github.com/topfreegames/maestro && go get github.com/golang/protobuf/protoc-gen-go google.golang.org/grpc golang.org/x/net/context && go build -o bin/grpc.so -buildmode=plugin plugins/grpc/forwarder.go"

0 comments on commit d5eaff4

Please sign in to comment.