2024-03-02 13:31:59 +00:00
|
|
|
# PODMAN_BIN's and tools
|
|
|
|
PODMAN_BIN?=$(shell which podman)
|
|
|
|
SKOPEO_BIN?=$(shell which skopeo)
|
2021-08-31 16:47:34 +00:00
|
|
|
|
|
|
|
# FETCHMAIL_IMAGE_REGISTRY_NAME
|
|
|
|
# Defines the name of the new container to be built using several variables.
|
|
|
|
FETCHMAIL_IMAGE_REGISTRY_NAME:=docker.io
|
|
|
|
FETCHMAIL_IMAGE_REGISTRY_USER:=volkerraschek
|
|
|
|
|
|
|
|
FETCHMAIL_IMAGE_NAMESPACE?=${FETCHMAIL_IMAGE_REGISTRY_USER}
|
2022-01-21 22:31:15 +00:00
|
|
|
FETCHMAIL_IMAGE_NAME:=postfixadmin-fetchmail
|
2021-08-31 16:47:34 +00:00
|
|
|
FETCHMAIL_IMAGE_VERSION?=latest
|
|
|
|
FETCHMAIL_IMAGE_FULLY_QUALIFIED=${FETCHMAIL_IMAGE_REGISTRY_NAME}/${FETCHMAIL_IMAGE_NAMESPACE}/${FETCHMAIL_IMAGE_NAME}:${FETCHMAIL_IMAGE_VERSION}
|
2024-03-02 13:31:59 +00:00
|
|
|
|
2021-08-31 16:47:34 +00:00
|
|
|
|
|
|
|
# BUILD CONTAINER IMAGE
|
|
|
|
# ==============================================================================
|
|
|
|
PHONY:=container-image/build
|
|
|
|
container-image/build:
|
2024-03-02 13:31:59 +00:00
|
|
|
${PODMAN_BIN} build \
|
2021-08-31 16:47:34 +00:00
|
|
|
--file Dockerfile \
|
|
|
|
--no-cache \
|
|
|
|
--pull \
|
|
|
|
--tag ${FETCHMAIL_IMAGE_FULLY_QUALIFIED} \
|
|
|
|
.
|
|
|
|
|
|
|
|
# DELETE CONTAINER IMAGE
|
|
|
|
# ==============================================================================
|
|
|
|
PHONY:=container-image/delete
|
|
|
|
container-image/delete:
|
2024-03-02 13:31:59 +00:00
|
|
|
- ${PODMAN_BIN} image rm ${FETCHMAIL_IMAGE_FULLY_QUALIFIED}
|
|
|
|
- ${PODMAN_BIN} image rm ${BASE_IMAGE_FULL}
|
2021-08-31 16:47:34 +00:00
|
|
|
|
|
|
|
# PUSH CONTAINER IMAGE
|
|
|
|
# ==============================================================================
|
|
|
|
PHONY+=container-image/push
|
|
|
|
container-image/push:
|
2024-03-02 13:31:59 +00:00
|
|
|
echo ${FETCHMAIL_IMAGE_REGISTRY_PASSWORD} | ${PODMAN_BIN} login ${FETCHMAIL_IMAGE_REGISTRY_NAME} --username ${FETCHMAIL_IMAGE_REGISTRY_USER} --password-stdin
|
|
|
|
${PODMAN_BIN} push ${FETCHMAIL_IMAGE_FULLY_QUALIFIED}
|
|
|
|
${PODMAN_BIN} logout ${FETCHMAIL_IMAGE_FULLY_QUALIFIED}
|
|
|
|
|
|
|
|
# PUSH CONTAINER IMAGE TO DOCKER
|
|
|
|
# ==============================================================================
|
|
|
|
PHONY+=container-image/push-to-docker-daemon
|
|
|
|
container-image/push-to-docker-daemon:
|
|
|
|
${PODMAN_BIN} push ${FETCHMAIL_IMAGE_FULLY_QUALIFIED} docker-daemon:${FETCHMAIL_IMAGE_FULLY_QUALIFIED}
|
2021-08-31 16:47:34 +00:00
|
|
|
|
|
|
|
# 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}
|