trufflehog/Dockerfile
Patryk Krawaczyński 8712e80c7e
Dockerfiles - Alpine Linux 3.15 EoL (#1914)
* Update Dockerfile - Alpine Linux 3.15 EoL

Support ends in 2 weeks (01 Nov 2023).

* Update Dockerfile.goreleaser - Alpine Linux 3.15 EoL

Support ends in 2 weeks (01 Nov 2023).
2023-10-24 09:19:42 -07:00

17 lines
598 B
Docker

FROM --platform=${BUILDPLATFORM} golang:bullseye as builder
WORKDIR /build
COPY . .
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 .
FROM alpine:3.16
RUN apk add --no-cache bash git openssh-client ca-certificates \
&& rm -rf /var/cache/apk/* && update-ca-certificates
COPY --from=builder /build/trufflehog /usr/bin/trufflehog
COPY entrypoint.sh /etc/entrypoint.sh
RUN chmod +x /etc/entrypoint.sh
ENTRYPOINT ["/etc/entrypoint.sh"]