Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

Commit

Permalink
Dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
blalor committed Jul 29, 2014
1 parent 8ca5362 commit 36f1b1c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM blalor/centos:latest
MAINTAINER Brian Lalor <[email protected]>

ADD release/docker-hosts /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/docker-hosts"]
33 changes: 31 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
NAME=docker-hosts
BIN=.godeps/bin

SOURCES=main.go hosts.go

.PHONY: all init build tools release clean

all: build

Expand All @@ -11,8 +16,32 @@ init: .godeps

build: stage/$(NAME)

stage/$(NAME): init *.go
gvp in go build -v -o stage/$(NAME) ./...
stage/$(NAME): init $(SOURCES)
gvp in go build -v -o $@ ./...

$(BIN)/gpm: init
curl -s -L -o $@ https://github.com/pote/gpm/raw/v1.2.3/bin/gpm
chmod +x $@

$(BIN)/gvp: init
curl -s -L -o $@ https://github.com/pote/gvp/raw/v0.1.0/bin/gvp
chmod +x $@

tools: $(BIN)/gpm $(BIN)/gvp

release/$(NAME): tools $(SOURCES)
docker run \
-i -t \
-v $(PWD):/gopath/src/app \
-w /gopath/src/app \
google/golang:1.3 \
$(BIN)/gvp in go build -v -o $@ ./...

release: release/$(NAME)

docker: release
docker build --tag=blalor/$(NAME) .
docker push blalor/$(NAME)

clean:
rm -rf stage release .godeps

0 comments on commit 36f1b1c

Please sign in to comment.