-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (28 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
29 lines (28 loc) · 1.07 KB
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
FROM golang:1.11.1 as builder
WORKDIR /go/src/github.com/gerald1248/cluster-tests/
ADD . ./
ENV CGO_ENABLED 0
ENV GOOS linux
ENV GO111MODULE on
RUN \
go mod download && \
go get && \
go vet && \
go test -v -cover && \
go build -o cluster-tests .
FROM ubuntu:18.10
WORKDIR /app/
ENV KUBE_VERSION=v1.12.0
EXPOSE 8080
RUN groupadd app && useradd -g app app && \
mkdir -p /app/output /app/cluster-tests.d && \
chmod -R 777 /app && \
chown app:app /app/cluster-tests.d /app/output
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y jq apt-transport-https wget curl gnupg
RUN wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl && \
chmod +x /usr/local/bin/kubectl
RUN mkdir -p /app/output
COPY --from=builder /go/src/github.com/gerald1248/cluster-tests/cluster-tests /usr/local/bin/cluster-tests
COPY --from=builder /go/src/github.com/gerald1248/cluster-tests/cluster-tests.d/* /app/cluster-tests.d/
USER app
CMD ["cluster-tests", "-d=/app/cluster-tests.d", "-o=/app/output"]