forked from ipedrazas/drone-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (41 loc) · 1.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# ----- Go Builder Image ------
#
FROM golang:1.8-alpine AS builder
RUN apk add --no-cache git
# set working directory
RUN mkdir -p /go/src/drone-helm
WORKDIR /go/src/drone-helm
# copy sources
COPY . .
# add dependencies
RUN go get
# run tests
RUN go test -v
# build binary
RUN go build -v -o "/drone-helm"
#
# ------ Drone-Helm plugin image ------
#
FROM alpine:3.6
MAINTAINER Ivan Pedrazas <[email protected]>
# Helm version: can be passed at build time (default to v2.5.1)
ARG VERSION
ENV VERSION ${VERSION:-v2.5.1}
ENV FILENAME helm-${VERSION}-linux-amd64.tar.gz
ARG KUBECTL
ENV KUBECTL ${KUBECTL:-v1.7.2}
RUN set -ex \
&& apk add --no-cache curl ca-certificates \
&& curl -o /tmp/${FILENAME} http://storage.googleapis.com/kubernetes-helm/${FILENAME} \
&& curl -o /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL}/bin/linux/amd64/kubectl \
&& tar -zxvf /tmp/${FILENAME} -C /tmp \
&& mv /tmp/linux-amd64/helm /bin/helm \
&& chmod +x /tmp/kubectl \
&& mv /tmp/kubectl /bin/kubectl \
&& rm -rf /tmp/*
LABEL description="Kubectl and Helm."
LABEL base="alpine"
COPY --from=builder /drone-helm /bin/drone-helm
COPY kubeconfig /root/.kube/kubeconfig
ENTRYPOINT [ "/bin/drone-helm" ]