Add Dockerfile

This commit is contained in:
knqyf263
2019-05-07 23:07:21 +09:00
parent d270edea75
commit 989b893bf2
2 changed files with 15 additions and 0 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
imgs

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM golang:1.12-alpine AS builder
ADD go.mod go.sum /app/
WORKDIR /app/
RUN apk --no-cache add git
RUN go mod download
ADD . /app/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /trivy cmd/trivy/main.go
FROM alpine:3.9
RUN apk --no-cache add ca-certificates git
COPY --from=builder /trivy /usr/local/bin/trivy
RUN chmod +x /usr/local/bin/trivy
CMD ["trivy"]