Skip to content

Commit

Permalink
Update Makefile to use "docker:GIT_BRANCH" as the generated image nam…
Browse files Browse the repository at this point in the history
…e for increased versatility

... and other minor Makefile improvements :)

Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
  • Loading branch information
tianon committed Jan 8, 2014
1 parent bb76985 commit a957128
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.PHONY: all binary build cross default docs shell test

DOCKER_RUN_DOCKER := docker run -rm -i -t -privileged -e TESTFLAGS -v $(CURDIR)/bundles:/go/src/github.com/dotcloud/docker/bundles docker
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
DOCKER_IMAGE := docker:$(GIT_BRANCH)
DOCKER_DOCS_IMAGE := docker-docs:$(GIT_BRANCH)
DOCKER_RUN_DOCKER := docker run -rm -i -t -privileged -e TESTFLAGS -v $(CURDIR)/bundles:/go/src/github.com/dotcloud/docker/bundles "$(DOCKER_IMAGE)"

default: binary

Expand All @@ -14,7 +17,8 @@ cross: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross

docs:
docker build -t docker-docs docs && docker run -p 8000:8000 docker-docs
docker build -rm -t "$(DOCKER_DOCS_IMAGE)" docs
docker run -rm -i -t -p 8000:8000 "$(DOCKER_DOCS_IMAGE)"

test: build
$(DOCKER_RUN_DOCKER) hack/make.sh test test-integration
Expand All @@ -23,7 +27,7 @@ shell: build
$(DOCKER_RUN_DOCKER) bash

build: bundles
docker build -t docker .
docker build -rm -t "$(DOCKER_IMAGE)" .

bundles:
mkdir bundles

0 comments on commit a957128

Please sign in to comment.