Skip to content

Commit

Permalink
Adjust Beats container user to be numeric. (#41197)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Montgomery <[email protected]>
  • Loading branch information
naemono authored Oct 14, 2024
1 parent e9617a7 commit a7915d8
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit a7915d8

Please sign in to comment.