Update Dockerfiles (#324)

This commit is contained in:
Adrian Gąsior 2022-04-08 23:06:09 +02:00 committed by GitHub
parent 37fce75c4a
commit 9d8bfaef50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View file

@ -1,12 +1,13 @@
FROM golang:bullseye as builder
RUN mkdir /build
COPY . /build
WORKDIR /build
RUN CGO_ENABLED=0 go build -a -o trufflehog main.go
RUN mkdir /empty
FROM alpine
RUN apk add git
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -a -o trufflehog main.go
FROM alpine:3.15
RUN apk add --no-cache git
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /build/trufflehog /usr/bin/trufflehog
ENTRYPOINT ["/usr/bin/trufflehog"]
ENTRYPOINT ["/usr/bin/trufflehog"]

View file

@ -1,4 +1,7 @@
FROM alpine
RUN apk add git
COPY trufflehog /usr/bin/trufflehog
FROM alpine:3.15
RUN apk add --no-cache git
WORKDIR /usr/bin/trufflehog
COPY trufflehog .
ENTRYPOINT ["/usr/bin/trufflehog"]