From 7dd67809ecc6a0c915c733725a1bd2462c57de60 Mon Sep 17 00:00:00 2001 From: Manjunath A Kumatagi Date: Wed, 8 Feb 2017 22:45:30 -0800 Subject: [PATCH] Docker image for ppc64le arch --- Makefile | 10 ++++++++-- rootfs/Dockerfile.ppc64le | 21 +++++++++++++++++++++ versioning.mk | 5 +++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 rootfs/Dockerfile.ppc64le diff --git a/Makefile b/Makefile index c3dda9d28..22350a600 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,8 @@ LDFLAGS := GOFLAGS := BINDIR := $(CURDIR)/bin BINARIES := helm tiller +ARCH := $(shell go env GOARCH) +DOCKERFILE:= Dockerfile # Required for globs to work correctly SHELL=/bin/bash @@ -59,11 +61,15 @@ check-docker: docker-binary: BINDIR = ./rootfs docker-binary: GOFLAGS += -a -installsuffix cgo docker-binary: - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller + GOOS=linux GOARCH=$(ARCH) CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller + +ifeq ($(ARCH),ppc64le) + DOCKERFILE = Dockerfile.ppc64le +endif .PHONY: docker-build docker-build: check-docker docker-binary - docker build --rm -t ${IMAGE} rootfs + docker build --rm -t ${IMAGE} -f rootfs/${DOCKERFILE} rootfs docker tag ${IMAGE} ${MUTABLE_IMAGE} .PHONY: test diff --git a/rootfs/Dockerfile.ppc64le b/rootfs/Dockerfile.ppc64le new file mode 100644 index 000000000..b625a857c --- /dev/null +++ b/rootfs/Dockerfile.ppc64le @@ -0,0 +1,21 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ppc64le/ubuntu:16.04 + +COPY . / + +EXPOSE 44134 + +CMD ["/tiller"] diff --git a/versioning.mk b/versioning.mk index 4825c4e72..6bcea88c8 100644 --- a/versioning.mk +++ b/versioning.mk @@ -16,6 +16,11 @@ BINARY_VERSION ?= ${GIT_TAG}-${GIT_SHA} IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${DOCKER_VERSION} MUTABLE_IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION} +ifeq ($(ARCH),ppc64le) + IMAGE = ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}-${ARCH}:${DOCKER_VERSION} + MUTABLE_IMAGE = ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}-${ARCH}:${MUTABLE_VERSION} +endif + LDFLAGS += -X k8s.io/helm/pkg/version.Version=${GIT_TAG} LDFLAGS += -X k8s.io/helm/pkg/version.GitCommit=${GIT_COMMIT} LDFLAGS += -X k8s.io/helm/pkg/version.GitTreeState=${GIT_DIRTY}