-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (34 loc) · 814 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PWD = $(shell pwd)
IMAGE_NAME = $(shell basename ${PWD})
BASE_IMAGE = $(shell grep Dockerfile -e FROM | cut -d ' ' -f 2)
#DOCKER_SOCKET = /var/run/docker.sock
BUILD_ARGS = --rm
DOCKER_ID_USER = dezinger
all: pull build push
pull:
##
## Pulling image updates from registry
##
for IMAGE in ${BASE_IMAGE}; \
do docker pull $${IMAGE}; \
done
build:
##
## Starting build of image ${IMAGE_NAME}
##
docker build ${BUILD_ARGS} --tag ${DOCKER_ID_USER}/${IMAGE_NAME} .
push:
##
## Push image
##
docker login
#docker tag ${IMAGE_NAME} ${DOCKER_ID_USER}/${IMAGE_NAME}
docker push ${DOCKER_ID_USER}/${IMAGE_NAME}
clean:
##
## Removing docker images .. most errors during this stage are ok, ignore them
##
for IMAGE in ${BASE_IMAGE}; \
do docker rmi $${IMAGE}; \
done
.PHONY: all pull build clean