Makefile 1.4 KB

1234567891011121314151617181920212223242526272829
  1. # sync with https://github.com/fphammerle/docker-onion-service/blob/master/Makefile
  2. DOCKER_IMAGE_NAME := docker.io/fphammerle/andrewjfreyer-mqtt-bluetooth-presence-monitor
  3. DOCKER_TAG_VERSION := $(shell git describe --match=v* --abbrev=0 --dirty | sed -e 's/^v//')
  4. # https://github.com/andrewjfreyer/monitor/blob/1deec402b9b6323a964381819b199300259bb58/monitor.sh#L28
  5. MONITOR_VERSION := 0.2.200
  6. ARCH := $(shell arch)
  7. DOCKER_TAG_ARCH_SUFFIX_aarch64 := arm64
  8. DOCKER_TAG_ARCH_SUFFIX_armv6l := armv6
  9. DOCKER_TAG_ARCH_SUFFIX_armv7l := armv7
  10. DOCKER_TAG_ARCH_SUFFIX_x86_64 := amd64
  11. DOCKER_TAG_ARCH_SUFFIX = ${DOCKER_TAG_ARCH_SUFFIX_${ARCH}}
  12. DOCKER_TAG = ${DOCKER_TAG_VERSION}-monitor${MONITOR_VERSION}-${DOCKER_TAG_ARCH_SUFFIX}
  13. .PHONY: docker-build podman-build docker-push
  14. docker-build:
  15. git diff --exit-code
  16. git diff --staged --exit-code
  17. sudo docker build --tag="${DOCKER_IMAGE_NAME}:${DOCKER_TAG}" .
  18. podman-build:
  19. # --format=oci (default) not fully supported by hub.docker.com
  20. # https://github.com/docker/hub-feedback/issues/1871#issuecomment-748924149
  21. podman build --format=docker --tag="${DOCKER_IMAGE_NAME}:${DOCKER_TAG}" .
  22. docker-push: docker-build
  23. sudo docker push "${DOCKER_IMAGE_NAME}:${DOCKER_TAG}"
  24. @echo git tag --sign --message '$(shell sudo docker image inspect --format '{{join .RepoDigests "\n"}}' "${DOCKER_IMAGE_NAME}:${DOCKER_TAG}")' docker/${DOCKER_TAG} $(shell git rev-parse HEAD)