-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
27 lines (21 loc) · 867 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
REG := 100225593120.dkr.ecr.us-east-1.amazonaws.com
DOCKER_PULL_TAG := build
DOCKER_BUILD_TAG := latest
registry-docker-login:
ifneq ($(shell echo ${REG} | egrep "ecr\..+\.amazonaws\.com"),)
@$(eval DOCKER_LOGIN_CMD=docker run --rm -it -v ~/.aws:/root/.aws amazon/aws-cli)
ifneq (${AWS_PROFILE},)
@$(eval DOCKER_LOGIN_CMD=${DOCKER_LOGIN_CMD} --profile ${AWS_PROFILE})
endif
@$(eval DOCKER_LOGIN_CMD=${DOCKER_LOGIN_CMD} ecr get-login-password | docker login -u AWS --password-stdin https://${REG})
${DOCKER_LOGIN_CMD}
endif
.PHONY: run
run: build
@docker run agrlocal/agr_schemas:${DOCKER_BUILD_TAG}
.PHONY: build
build: pull
@docker build -t agrlocal/agr_schemas:${DOCKER_BUILD_TAG} --build-arg REG=${REG} --build-arg DOCKER_PULL_TAG=${DOCKER_PULL_TAG} .
.PHONEY: pull
pull: registry-docker-login
@docker pull ${REG}/agr_java_software:${DOCKER_PULL_TAG}