Skip to content

Commit

Permalink
refactor: Rework entry point scripts to run 'listenTcp' command as no…
Browse files Browse the repository at this point in the history
…n-root (#3292)

* refactor: Rework entry point scripts to run 'listenTcp' command as non-root

closes #3221

Signed-off-by: lenny <[email protected]>
  • Loading branch information
lenny-goodell authored Mar 24, 2021
1 parent 18e95d4 commit 5dc7e56
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ else
fi

# Signal that Consul is ready for services blocked waiting on Consul
/edgex-init/security-bootstrapper --confdir=/edgex-init/res listenTcp \
exec su-exec consul /edgex-init/security-bootstrapper --confdir=/edgex-init/res listenTcp \
--port="${STAGEGATE_REGISTRY_READYPORT}" --host="${STAGEGATE_REGISTRY_HOST}"
if [ $? -ne 0 ]; then
echo "$(date) failed to gating the consul ready port, exits"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ done
echo "$(date) ${STAGEGATE_KONGDB_HOST} is initialized"

# Signal that Postgres is ready for services blocked waiting on Postgres
/edgex-init/security-bootstrapper --confdir=/edgex-init/res listenTcp \
exec su-exec postgres /edgex-init/security-bootstrapper --confdir=/edgex-init/res listenTcp \
--port="${STAGEGATE_KONGDB_READYPORT}" --host="${STAGEGATE_KONGDB_HOST}"
if [ $? -ne 0 ]; then
echo "$(date) failed to gating the postgres ready port, exits"
Expand Down
2 changes: 1 addition & 1 deletion cmd/security-secretstore-setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN make cmd/security-file-token-provider/security-file-token-provider \

FROM alpine:3.12

RUN apk add --update --no-cache ca-certificates dumb-init curl
RUN apk add --update --no-cache ca-certificates dumb-init curl su-exec

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2019: Dell Technologies, Inc.'
Expand Down
2 changes: 1 addition & 1 deletion cmd/security-secretstore-setup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ echo "$(date) Changing ownership of secrets to ${EDGEX_USER}:${EDGEX_GROUP}"
chown -Rh ${EDGEX_USER}:${EDGEX_GROUP} /tmp/edgex/secrets

# Signal tokens ready port for other services waiting on
/edgex-init/security-bootstrapper --confdir=/edgex-init/res listenTcp \
exec su-exec ${EDGEX_USER} /edgex-init/security-bootstrapper --confdir=/edgex-init/res listenTcp \
--port="${STAGEGATE_SECRETSTORESETUP_TOKENS_READYPORT}" --host="${STAGEGATE_SECRETSTORESETUP_HOST}"
if [ $? -ne 0 ]; then
echo "$(date) failed to gating the tokens ready port"
Expand Down

0 comments on commit 5dc7e56

Please sign in to comment.