jq-docker/Makefile

52 lines
2.0 KiB
Makefile
Raw Normal View History

2023-03-26 13:53:33 +00:00
# JQ_VERSION
# Only required to install a specifiy version
2023-03-26 15:53:42 +00:00
JQ_VERSION?=1.6 # renovate: datasource=github-releases depName=stedolan/jq
2023-03-26 13:53:33 +00:00
# CONTAINER_RUNTIME
# The CONTAINER_RUNTIME variable will be used to specified the path to a
# container runtime. This is needed to start and run a container image.
CONTAINER_RUNTIME?=$(shell which podman)
# JQ_IMAGE_REGISTRY_NAME
# Defines the name of the new container to be built using several variables.
2023-06-15 14:30:12 +00:00
JQ_IMAGE_REGISTRY_NAME:=git.cryptic.systems
JQ_IMAGE_REGISTRY_USER:=volker.raschek
2023-03-26 13:53:33 +00:00
JQ_IMAGE_NAMESPACE?=${JQ_IMAGE_REGISTRY_USER}
JQ_IMAGE_NAME:=jq
JQ_IMAGE_VERSION?=latest
JQ_IMAGE_FULLY_QUALIFIED=${JQ_IMAGE_REGISTRY_NAME}/${JQ_IMAGE_NAMESPACE}/${JQ_IMAGE_NAME}:${JQ_IMAGE_VERSION}
JQ_IMAGE_UNQUALIFIED=${JQ_IMAGE_NAMESPACE}/${JQ_IMAGE_NAME}:${JQ_IMAGE_VERSION}
# BUILD CONTAINER IMAGE
# ==============================================================================
PHONY:=container-image/build
container-image/build:
${CONTAINER_RUNTIME} build \
--build-arg JQ_VERSION=${JQ_VERSION} \
--file Dockerfile \
--no-cache \
--pull \
--tag ${JQ_IMAGE_FULLY_QUALIFIED} \
--tag ${JQ_IMAGE_UNQUALIFIED} \
.
# DELETE CONTAINER IMAGE
# ==============================================================================
PHONY:=container-image/delete
container-image/delete:
- ${CONTAINER_RUNTIME} image rm ${JQ_IMAGE_FULLY_QUALIFIED} ${JQ_IMAGE_UNQUALIFIED}
- ${CONTAINER_RUNTIME} image rm ${BASE_IMAGE_FULL}
# PUSH CONTAINER IMAGE
# ==============================================================================
PHONY+=container-image/push
container-image/push:
echo ${JQ_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${JQ_IMAGE_REGISTRY_NAME} --username ${JQ_IMAGE_REGISTRY_USER} --password-stdin
${CONTAINER_RUNTIME} push ${JQ_IMAGE_FULLY_QUALIFIED}
# PHONY
# ==============================================================================
# Declare the contents of the PHONY variable as phony. We keep that information
# in a variable so we can use it in if_changed.
.PHONY: ${PHONY}