docker: fix docker entrypoint to allow the command option
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -33,6 +33,7 @@ FROM --platform=$TARGETPLATFORM ${from}
|
|||||||
|
|
||||||
COPY --from=build /go/bin/go-away /bin/go-away
|
COPY --from=build /go/bin/go-away /bin/go-away
|
||||||
COPY examples/snippets/ /snippets/
|
COPY examples/snippets/ /snippets/
|
||||||
|
COPY docker-entrypoint.sh /
|
||||||
|
|
||||||
ENV TZ UTC
|
ENV TZ UTC
|
||||||
|
|
||||||
@@ -63,13 +64,4 @@ EXPOSE 6060/tcp
|
|||||||
|
|
||||||
ENV JWT_PRIVATE_KEY_SEED="${GOAWAY_JWT_PRIVATE_KEY_SEED}"
|
ENV JWT_PRIVATE_KEY_SEED="${GOAWAY_JWT_PRIVATE_KEY_SEED}"
|
||||||
|
|
||||||
ENTRYPOINT /bin/go-away --bind "${GOAWAY_BIND}" --bind-network "${GOAWAY_BIND_NETWORK}" --socket-mode "${GOAWAY_SOCKET_MODE}" \
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
--metrics-bind "${GOAWAY_METRICS_BIND}" --debug-bind "${GOAWAY_DEBUG_BIND}" \
|
|
||||||
--config "${GOAWAY_CONFIG}" \
|
|
||||||
--policy "${GOAWAY_POLICY}" --policy-snippets "/snippets" --policy-snippets "${GOAWAY_POLICY_SNIPPETS}" \
|
|
||||||
--client-ip-header "${GOAWAY_CLIENT_IP_HEADER}" --backend-ip-header "${GOAWAY_BACKEND_IP_HEADER}" \
|
|
||||||
--cache "${GOAWAY_CACHE}" \
|
|
||||||
--challenge-template "${GOAWAY_CHALLENGE_TEMPLATE}" --challenge-template-theme "${GOAWAY_CHALLENGE_TEMPLATE_THEME}" \
|
|
||||||
--slog-level "${GOAWAY_SLOG_LEVEL}" \
|
|
||||||
--acme-autocert "${GOAWAY_ACME_AUTOCERT}" \
|
|
||||||
--backend "${GOAWAY_BACKEND}"
|
|
||||||
|
24
docker-entrypoint.sh
Executable file
24
docker-entrypoint.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "${1#-}" != "$1" ]; then
|
||||||
|
set -- /bin/go-away \
|
||||||
|
--bind "${GOAWAY_BIND}" --bind-network "${GOAWAY_BIND_NETWORK}" --socket-mode "${GOAWAY_SOCKET_MODE}" \
|
||||||
|
--metrics-bind "${GOAWAY_METRICS_BIND}" --debug-bind "${GOAWAY_DEBUG_BIND}" \
|
||||||
|
--config "${GOAWAY_CONFIG}" \
|
||||||
|
--policy "${GOAWAY_POLICY}" --policy-snippets "/snippets" --policy-snippets "${GOAWAY_POLICY_SNIPPETS}" \
|
||||||
|
--client-ip-header "${GOAWAY_CLIENT_IP_HEADER}" --backend-ip-header "${GOAWAY_BACKEND_IP_HEADER}" \
|
||||||
|
--cache "${GOAWAY_CACHE}" \
|
||||||
|
--challenge-template "${GOAWAY_CHALLENGE_TEMPLATE}" --challenge-template-theme "${GOAWAY_CHALLENGE_TEMPLATE_THEME}" \
|
||||||
|
--slog-level "${GOAWAY_SLOG_LEVEL}" \
|
||||||
|
--acme-autocert "${GOAWAY_ACME_AUTOCERT}" \
|
||||||
|
--backend "${GOAWAY_BACKEND}" \
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "go-away" ]; then
|
||||||
|
shift
|
||||||
|
set -- /bin/go-away "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
Reference in New Issue
Block a user