Skip to content

Find, verify, and analyze leaked credentials

Update entrypoint (#1013)

ahrav477e2a1332f0
diff --git a/Dockerfile b/Dockerfile
index 817f4da7a..64e299229 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,7 +9,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o trufflehog .
FROM alpine:3.15
-RUN apk add --no-cache git ca-certificates \
+RUN apk add --no-cache bash git ca-certificates \
&& rm -rf /var/cache/apk/* && \
update-ca-certificates
COPY --from=builder /build/trufflehog /usr/bin/trufflehog
diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser
index aa79ef33f..dc4cfda3b 100644
--- a/Dockerfile.goreleaser
+++ b/Dockerfile.goreleaser
@@ -1,6 +1,6 @@
FROM alpine:3.15
-RUN apk add --no-cache git ca-certificates \
+RUN apk add --no-cache bash git ca-certificates \
&& rm -rf /var/cache/apk/* && \
update-ca-certificates
WORKDIR /usr/bin/
diff --git a/entrypoint.sh b/entrypoint.sh
index 4ef5e69bc..7db98e4b4 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,5 +1,6 @@
-#!/usr/bin/env ash
+#!/usr/bin/env bash
-# `$*` expands the `args` supplied in an `array` individually
-# or splits `args` in a string separated by whitespace.
-/usr/bin/trufflehog $*
\ No newline at end of file
+# Parse the last argument into an array of extra_args.
+mapfile -t extra_args < <(bash -c "for arg in ${*: -1}; do echo \$arg; done")
+
+/usr/bin/trufflehog "${@: 1: $#-1}" "${extra_args[@]}"
\ No newline at end of file