19 lines
657 B
Makefile
19 lines
657 B
Makefile
|
NAME=$$(head -1 Dockerfile|grep NAME |awk '{print $$3}')
|
||
|
VERSION=$$(grep VERSION Dockerfile |awk '{print $$3}')
|
||
|
REGISTRY=registry.leenooks.net
|
||
|
SUBDIRS := $(wildcard */.)
|
||
|
.PHONY: all build image $(SUBDIRS)
|
||
|
|
||
|
all: build
|
||
|
|
||
|
build: Dockerfile
|
||
|
@if test "$(NAME)" = ""; then echo "NAME not in Dockerfile."; exit 1; fi
|
||
|
@if test "$(VERSION)" = ""; then echo "VERSION not in Dockerfile."; exit 1; fi
|
||
|
@if test -f image.bz2; then rm -f image.bz2; fi
|
||
|
@#docker pull $(NAME):$(VERSION)
|
||
|
@#docker build --cache-from $(NAME):$(VERSION) -t $(NAME):$(VERSION) .
|
||
|
docker build -t $(NAME):$(VERSION) .
|
||
|
|
||
|
image: Dockerfile
|
||
|
docker save $(NAME):$(VERSION) | bzip2 -9 > image.bz2
|