diff --git a/docker/Dockerfile b/docker/Dockerfile index f0349475..5d92d8e9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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"] diff --git a/docker/Makefile b/docker/Makefile index 9226830b..6a6cc65e 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -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)