container-images/fedora-dev/Makefile

34 lines
600 B
Makefile
Raw Permalink Normal View History

DOCKER ?= $(shell which docker)
FROM_IMAGE ?= fedora
#FROM_TAG ?= 21
FROM_TAG ?= latest
FROM := $(FROM_IMAGE):$(FROM_TAG)
REGISTRY ?= docker.usersys
NAME ?= $(REGISTRY)/$(USER)/$(FROM_IMAGE)-dev:$(FROM_TAG)
default: build
Dockerfile: Dockerfile.in
2015-05-12 13:31:40 +00:00
m4 \
--define=DEV_USER=$(USER) \
--define=DEV_UID=$(shell id -u $(USER)) \
--define=DEV_GID=$(shell id -g $(USER)) \
--define=FROM_IMAGE=$(FROM) \
$< > $@
build: .build
.build: Dockerfile .pull
$(DOCKER) build -t $(NAME) . && touch $@
pull: .pull
.pull:
$(DOCKER) pull $(FROM) && touch $@
clean:
rm -rf .build .pull Dockerfile *~