From cce50f805247119028b9ecc046887ddf0b16d3d7 Mon Sep 17 00:00:00 2001 From: Maciej Kwiek Date: Mon, 13 Mar 2017 14:50:08 +0100 Subject: [PATCH] Add experimental dockerfiles Added dockerfiles for rudder service and tiller run with --experimental-release flag --- .gitignore | 1 + Makefile | 21 +++++++++++++++------ rootfs/Dockerfile.experimental | 24 ++++++++++++++++++++++++ rootfs/Dockerfile.rudder | 23 +++++++++++++++++++++++ versioning.mk | 7 ++++--- 5 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 rootfs/Dockerfile.experimental create mode 100644 rootfs/Dockerfile.rudder diff --git a/.gitignore b/.gitignore index 12b7ab7bc..b94f87b26 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ _dist/ _proto/*.pb.go bin/ rootfs/tiller +rootfs/rudder vendor/ *.exe .idea/ diff --git a/Makefile b/Makefile index d9d869a3b..86d9b76e9 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ -DOCKER_REGISTRY ?= gcr.io -IMAGE_PREFIX ?= kubernetes-helm -SHORT_NAME ?= tiller -TARGETS = darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64 -DIST_DIRS = find * -type d -exec -APP = helm +DOCKER_REGISTRY ?= gcr.io +IMAGE_PREFIX ?= kubernetes-helm +SHORT_NAME ?= tiller +SHORT_NAME_RUDDER ?= rudder +TARGETS = darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64 +DIST_DIRS = find * -type d -exec +APP = helm # go option GO ?= go @@ -60,12 +61,20 @@ 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=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/rudder $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/rudder .PHONY: docker-build docker-build: check-docker docker-binary docker build --rm -t ${IMAGE} rootfs docker tag ${IMAGE} ${MUTABLE_IMAGE} +.PHONY: docker-build-experimental +docker-build-experimental: check-docker docker-binary + docker build --rm -t ${IMAGE} rootfs -f rootfs/Dockerfile.experimental + docker tag ${IMAGE} ${MUTABLE_IMAGE} + docker build --rm -t ${IMAGE_RUDDER} rootfs -f rootfs/Dockerfile.rudder + docker tag ${IMAGE_RUDDER} ${MUTABLE_IMAGE_RUDDER} + .PHONY: test test: build test: TESTFLAGS += -race -v diff --git a/rootfs/Dockerfile.experimental b/rootfs/Dockerfile.experimental new file mode 100644 index 000000000..0528471e6 --- /dev/null +++ b/rootfs/Dockerfile.experimental @@ -0,0 +1,24 @@ +# 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 alpine:3.3 + +ENV HOME /tmp + +COPY . / + +EXPOSE 44134 + +CMD ["/tiller", "--experimental-release"] + diff --git a/rootfs/Dockerfile.rudder b/rootfs/Dockerfile.rudder new file mode 100644 index 000000000..d39d0ebdb --- /dev/null +++ b/rootfs/Dockerfile.rudder @@ -0,0 +1,23 @@ +# 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 alpine:3.3 + +ENV HOME /tmp + +COPY . / + +EXPOSE 10001 + +CMD ["/rudder"] diff --git a/versioning.mk b/versioning.mk index 83921f04d..2333530d9 100644 --- a/versioning.mk +++ b/versioning.mk @@ -22,12 +22,13 @@ endif ifneq ($(GIT_TAG),) LDFLAGS += -X k8s.io/helm/pkg/version.BuildMetadata= endif - LDFLAGS += -X k8s.io/helm/pkg/version.GitCommit=${GIT_COMMIT} LDFLAGS += -X k8s.io/helm/pkg/version.GitTreeState=${GIT_DIRTY} -IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${DOCKER_VERSION} -MUTABLE_IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION} +IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${DOCKER_VERSION} +IMAGE_RUDDER := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME_RUDDER}:${DOCKER_VERSION} +MUTABLE_IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION} +MUTABLE_IMAGE_RUDDER := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME_RUDDER}:${DOCKER_VERSION} DOCKER_PUSH = docker push ifeq ($(DOCKER_REGISTRY),gcr.io)