Browse Source

make: added docker-build target

Fabian Peter Hammerle 3 weeks ago
parent
commit
54a3c74eae
1 changed files with 12 additions and 0 deletions
  1. 12 0
      Makefile

+ 12 - 0
Makefile

@@ -0,0 +1,12 @@
+DOCKER_IMAGE_NAME := fphammerle/systemctl-mqtt
+DOCKER_TAG_VERSION := $(shell git describe --match=v* --dirty | sed -e 's/^v//')
+ARCH := $(shell arch)
+DOCKER_TAG_ARCH_SUFFIX_armv6l := armv6
+DOCKER_TAG_ARCH_SUFFIX_x86_64 := amd64
+DOCKER_TAG_ARCH_SUFFIX = ${DOCKER_TAG_ARCH_SUFFIX_${ARCH}}
+DOCKER_TAG = ${DOCKER_TAG_VERSION}-${DOCKER_TAG_ARCH_SUFFIX}
+
+.PHONY: docker-build
+
+docker-build:
+	sudo docker build -t "${DOCKER_IMAGE_NAME}:${DOCKER_TAG}" .