Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x](backport #41197) Adjust Beats container user to be numeric. #41280

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dev-tools/packaging/templates/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ RUN cd /usr/share/heartbeat/.node \
&& curl ${NODE_DOWNLOAD_URL} | tar -xJ --strip 1 -C node \
&& chmod ug+rwX -R $NODE_PATH

# Install synthetics as a regular user, installing npm deps as root odesn't work
# Install synthetics as a regular user, installing npm deps as root doesn't work
RUN chown -R {{ .user }} $NODE_PATH
USER {{ .user }}
# If this fails dump the NPM logs
Expand All @@ -227,7 +227,11 @@ done; \
(exit $exit_code)
{{- end }}

USER {{ .user }}
{{- if eq .user "root" }}
USER 0
{{- else }}
USER 1000
{{- end }}

{{- range $i, $port := .ExposePorts }}
EXPOSE {{ $port }}
Expand Down
Loading