From e8da5903f1df20f39af24ff10864d1b4560e29d8 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Tue, 26 May 2015 14:54:46 +0000 Subject: [PATCH] Small enhancements to the example app - Explicity add go app to the example container, so it fails if you haven't built it. - spin up 2 goapps and 3 elastic searches --- experimental/example/Makefile | 2 +- experimental/example/docker-compose.yml | 22 ++++++++++++++++++++-- experimental/example/goapp/Dockerfile | 2 +- experimental/example/goapp/entrypoint.sh | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/experimental/example/Makefile b/experimental/example/Makefile index b68a18a73..af1d28648 100644 --- a/experimental/example/Makefile +++ b/experimental/example/Makefile @@ -10,7 +10,7 @@ qotd/qotd: qotd/qotd.o gcc -o $@ $< $(CFLAGS) goapp/app: goapp/app.go - go build -o goapp/app ./goapp + go build -ldflags "-extldflags \"-static\"" -tags netgo -o goapp/app ./goapp clean: rm -f qotd/*.o qotd/qotd goapp/app diff --git a/experimental/example/docker-compose.yml b/experimental/example/docker-compose.yml index 8a7b5c13e..b8b81cbf3 100644 --- a/experimental/example/docker-compose.yml +++ b/experimental/example/docker-compose.yml @@ -10,20 +10,30 @@ pyapp: links: - qotd - redis - - goapp + - goapp1 + - goapp2 qotd: build: qotd expose: - "4446" redis: image: redis -goapp: +goapp1: build: goapp ports: - "8080" links: - elasticsearch1 - elasticsearch2 + - elasticsearch3 +goapp2: + build: goapp + ports: + - "8080" + links: + - elasticsearch1 + - elasticsearch2 + - elasticsearch3 elasticsearch1: image: elasticsearch expose: @@ -36,3 +46,11 @@ elasticsearch2: - "9300" links: - elasticsearch1 +elasticsearch3: + image: elasticsearch + expose: + - "9200" + - "9300" + links: + - elasticsearch1 + - elasticsearch2 diff --git a/experimental/example/goapp/Dockerfile b/experimental/example/goapp/Dockerfile index 1157068f9..0bfa9fe4d 100644 --- a/experimental/example/goapp/Dockerfile +++ b/experimental/example/goapp/Dockerfile @@ -1,5 +1,5 @@ FROM gliderlabs/alpine MAINTAINER Weaveworks Inc WORKDIR /home/weave -ADD . /home/weave/ +ADD app entrypoint.sh /home/weave/ ENTRYPOINT ["/home/weave/entrypoint.sh"] diff --git a/experimental/example/goapp/entrypoint.sh b/experimental/example/goapp/entrypoint.sh index 71bf2b93c..8837a8b30 100755 --- a/experimental/example/goapp/entrypoint.sh +++ b/experimental/example/goapp/entrypoint.sh @@ -1,2 +1,2 @@ #!/bin/sh -exec /home/weave/app elasticsearch1 elasticsearch2 +exec /home/weave/app elasticsearch1 elasticsearch2 elasticsearch3