Skip to content

Instantly share code, notes, and snippets.

@lukassup
Created April 17, 2018 20:34
Show Gist options
  • Save lukassup/da1620974c25b53707ffbac196f8a2eb to your computer and use it in GitHub Desktop.
Save lukassup/da1620974c25b53707ffbac196f8a2eb to your computer and use it in GitHub Desktop.
FROM golang:1.10 as build
RUN apt-get update && apt-get install -y rsync
WORKDIR /go/src/k8s.io/kubernetes
ARG KUBE_VERSION=v1.10.1
ENV KUBE_VERSION=${KUBE_VERSION}
RUN git clone --depth=1 --branch="${KUBE_VERSION}" https://github.com/kubernetes/kubernetes.git .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 KUBE_BUILD_PLATFORMS=linux/amd64 make WHAT=cmd/kubectl
WORKDIR /go/src/k8s.io/helm
ARG HELM_VERSION=v2.8.2
ENV HELM_VERSION=${HELM_VERSION}
RUN git clone --depth=1 --branch="${HELM_VERSION}" https://github.com/kubernetes/helm.git .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 make TARGETS=linux/amd64 BINARIES=helm bootstrap build
FROM alpine:3.7
RUN apk add --no-cache ca-certificates
COPY --from=build /go/src/k8s.io/kubernetes/_output/local/bin/linux/amd64/kubectl /usr/local/bin/kubectl
COPY --from=build /go/src/k8s.io/helm/bin/helm /usr/local/bin/helm
RUN adduser kube -D
USER kube
WORKDIR /home/kube
VOLUME /home/kube/.kube
VOLUME /home/kube/.helm
ENTRYPOINT ["/usr/local/bin/helm"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment