forked from rebuy-de/aws-nuke
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 689 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (24 loc) · 689 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
# Source: https://github.com/rebuy-de/golang-template
FROM golang:1.13-alpine as builder
RUN apk add --no-cache git make curl openssl
# Configure Go
ENV GOPATH=/go PATH=/go/bin:$PATH CGO_ENABLED=0 GO111MODULE=on
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
ENV GO111MODULE on
# Install Go Tools
RUN go get -u golang.org/x/lint/golint
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN set -x \
&& make test \
&& make build \
&& cp /src/dist/aws-nuke /usr/local/bin/
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/local/bin/* /usr/local/bin/
RUN adduser -D aws-nuke
USER aws-nuke
ENTRYPOINT ["/usr/local/bin/aws-nuke"]