forked from jghiloni/helm-chart-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (29 loc) · 992 Bytes
/
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
FROM golang:1 AS builder
COPY . /src
WORKDIR /src
ENV CGO_ENABLED 0
RUN go get -d ./...
RUN go build -o /assets/check ./cmd/check
RUN go build -o /assets/in ./cmd/in
RUN cp ./cmd/out/out.sh /assets/out
RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done
FROM alpine:edge AS resource
ARG VERSION=3.2.2
RUN apk add --update --no-cache bash jq git tzdata curl ca-certificates && \
curl -L https://get.helm.sh/helm-v${VERSION}-linux-amd64.tar.gz |tar xvz && \
mv linux-amd64/helm /usr/bin/helm && \
chmod +x /usr/bin/helm && \
rm -rf linux-amd64 && \
rm -f /var/cache/apk/*
RUN helm plugin install --version master https://github.com/linkyard/helm-nexus-push.git
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*
FROM resource AS tests
COPY --from=builder /tests /tests
ADD . /docker-image-resource
RUN set -e; for test in /tests/*.test; do \
$test; \
done
FROM resource