2022-07-26 20:43:42 +00:00
|
|
|
FROM --platform=${BUILDPLATFORM} golang:bullseye as builder
|
2022-04-08 21:06:09 +00:00
|
|
|
|
2022-01-19 00:59:18 +00:00
|
|
|
WORKDIR /build
|
2022-04-08 21:06:09 +00:00
|
|
|
COPY . .
|
2022-07-26 20:43:42 +00:00
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
ARG TARGETOS TARGETARCH
|
|
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
|
|
GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o trufflehog .
|
2022-01-19 00:59:18 +00:00
|
|
|
|
2022-04-08 21:06:09 +00:00
|
|
|
FROM alpine:3.15
|
2023-01-26 17:26:03 +00:00
|
|
|
RUN apk add --no-cache bash git openssh-client ca-certificates \
|
2022-08-02 19:50:26 +00:00
|
|
|
&& rm -rf /var/cache/apk/* && \
|
|
|
|
update-ca-certificates
|
2022-01-19 00:59:18 +00:00
|
|
|
COPY --from=builder /build/trufflehog /usr/bin/trufflehog
|
2022-08-01 22:05:08 +00:00
|
|
|
COPY entrypoint.sh /etc/entrypoint.sh
|
|
|
|
RUN chmod +x /etc/entrypoint.sh
|
|
|
|
ENTRYPOINT ["/etc/entrypoint.sh"]
|