From de08e38c5ec321d879fc3b26917263b779ed776e Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Thu, 17 Aug 2017 15:23:04 +0530 Subject: [PATCH] Add dockerfile for ppc64le (#638) * Add dockerfile for ppc64le and related changes * Pass the fill file as DOCKEFILE * Add the dockerfile name to build msg --- Dockerfile.ppc64le | 7 +++++++ Makefile | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.ppc64le diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le new file mode 100644 index 00000000..75c1aaf5 --- /dev/null +++ b/Dockerfile.ppc64le @@ -0,0 +1,7 @@ +FROM ppc64le/busybox:glibc + +COPY node_exporter /bin/node_exporter + +EXPOSE 9100 +USER nobody +ENTRYPOINT [ "/bin/node_exporter" ] diff --git a/Makefile b/Makefile index deea0548..8ef57c08 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,8 @@ PREFIX ?= $(shell pwd) BIN_DIR ?= $(shell pwd) DOCKER_IMAGE_NAME ?= node-exporter DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) +MACH ?= $(shell uname -m) +DOCKERFILE ?= Dockerfile ifeq ($(OS),Windows_NT) OS_detected := Windows @@ -77,8 +79,11 @@ tarball: $(PROMU) @$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) docker: - @echo ">> building docker image" - @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . +ifeq ($(MACH), ppc64le) + $(eval DOCKERFILE=Dockerfile.ppc64le) +endif + @echo ">> building docker image from $(DOCKERFILE)" + @docker build --file $(DOCKERFILE) -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . test-docker: @echo ">> testing docker image"