Skip to content

Commit

Permalink
simplify docker builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikulas committed Sep 11, 2017
1 parent 12caf4c commit 961e284
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
7 changes: 2 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ FROM node:7

MAINTAINER mangoweb

RUN npm install -g https://github.com/manGoweb/mango-cli.git#deploy/dockerhub

ENV HOST_MOUNT /usr/src/build
VOLUME [$HOST_MOUNT]
WORKDIR $HOST_MOUNT
ARG version=master
RUN npm install -g https://github.com/manGoweb/mango-cli.git#$version

ENTRYPOINT ["mango"]
CMD ["build"]
28 changes: 9 additions & 19 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
_: build
ORG = mangoweb
REPO = mango-cli
TAG = latest

IMAGE="mango-cli"
ECR="831119889470.dkr.ecr.eu-west-1.amazonaws.com"
all: build publish

build:
docker build -t ${IMAGE} .
build: Dockerfile
docker build --build-arg version=$(TAG) -t $(REPO):$(TAG) .

aws: aws-tag aws-push
aws-tag:
docker tag ${IMAGE}:latest ${ECR}/${IMAGE}:latest
aws-push:
docker push ${ECR}/${IMAGE}:latest

dockerhub: dockerhub-tag dockerhub-push
dockerhub-tag:
docker tag ${IMAGE}:latest mangoweb/${IMAGE}:latest
dockerhub-push:
docker push mangoweb/${IMAGE}:latest


.PHONY: build aws aws-tag aws-push dockerhub dockerhub-tag dockerhub-push
publish: Dockerfile
docker tag $(REPO):$(TAG) $(ORG)/$(REPO):$(TAG)
docker push $(ORG)/$(REPO):$(TAG)

0 comments on commit 961e284

Please sign in to comment.