Commit 967e1f21 authored by Markus Frosch's avatar Markus Frosch 📣

Adapt default image name and cache behavior

parent a94918fa
Pipeline #2298 failed with stage
in 35 seconds
......@@ -2,7 +2,7 @@ OS := fedora
IMAGE_PREFIX := ${DOCKER_IMAGE_PREFIX}
ifeq ($(IMAGE_PREFIX),)
IMAGE_PREFIX := icinga/
IMAGE_PREFIX := icinga/$(OS)/
endif
REGISTRY := ${DOCKER_REGISTRY}
......@@ -11,16 +11,19 @@ IMAGE_PREFIX := $(REGISTRY)/$(IMAGE_PREFIX)
endif
FROM := $(shell grep FROM Dockerfile | cut -d" " -f2)
ifeq ($(VERSION),)
VERSION := $(shell basename `pwd`)
IMAGE := $(IMAGE_PREFIX)$(OS)-$(VERSION)$(IMAGE_SUFFIX)
endif
IMAGE := $(IMAGE_PREFIX)$(VERSION):$(VARIANT)
all: pull build
pull:
docker pull "$(IMAGE)" || true
docker pull "$(FROM)"
build:
docker build -t "$(IMAGE)" .
docker build --cache-from "$(IMAGE)" --tag "$(IMAGE)" .
push:
docker push "$(IMAGE)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment