Skip to content

Commit

Permalink
Make envoy user part of the tty group instead of chown stderr/stdout (e…
Browse files Browse the repository at this point in the history
…nvoyproxy#34830)

Signed-off-by: Razvan Dobre <dobre@adobe.com>
  • Loading branch information
dobrerazvan authored Jun 25, 2024
1 parent c16a718 commit 43d6b1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ci/Dockerfile-envoy
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ FROM ${BUILD_OS}:${BUILD_TAG} AS envoy-base
ENV DEBIAN_FRONTEND=noninteractive
EXPOSE 10000
CMD ["envoy", "-c", "/etc/envoy/envoy.yaml"]
# Ensure the envoy user is able to write to container logs owned by root:tty
RUN mkdir -p /etc/envoy \
&& adduser --group --system envoy
&& useradd --system --no-create-home -d /nonexistent --groups tty --shell /usr/sbin/nologin envoy
ENTRYPOINT ["/docker-entrypoint.sh"]
# NB: Adding this here means that following steps, for example updating the system packages, are run
# when the version file changes. This should mean that a release version will always update.
Expand Down
2 changes: 0 additions & 2 deletions ci/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ if [ "$ENVOY_UID" != "0" ] && [ "$USERID" = 0 ]; then
if [ -n "$ENVOY_GID" ]; then
groupmod -g "$ENVOY_GID" envoy
fi
# Ensure the envoy user is able to write to container logs
chown envoy:envoy /dev/stdout /dev/stderr
exec su-exec envoy "${@}"
else
exec "${@}"
Expand Down

0 comments on commit 43d6b1e

Please sign in to comment.