Skip to content
Snippets Groups Projects
Commit 967e1f21 authored by Markus Frosch's avatar Markus Frosch
Browse files

Adapt default image name and cache behavior

parent a94918fa
No related branches found
No related tags found
No related merge requests found
Pipeline #2298 failed
......@@ -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)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment