-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 729 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 729 Bytes
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
FROM golang:alpine3.8
RUN apk --update add git openssh upx build-base && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*
WORKDIR /app
COPY . /app
RUN mkdir -p /dist
RUN go fmt $(go list ./... | grep -v /vendor/)
RUN go vet $(go list ./... | grep -v /vendor/)
RUN go test ./...
RUN go build -o /dist/cleaner && upx /dist/cleaner
FROM alpine:3.8
USER root
LABEL maintainer=philipp@haussleiter.de
ADD cert/* /tmp/cert/
RUN apk add --update ca-certificates && \
cp -R /tmp/cert/* /usr/share/ca-certificates/ && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*
COPY --from=0 /dist/cleaner /app/cleaner
ENV PATH=/app:$PATH
WORKDIR /app
CMD ["/app/cleaner"]