Skip to content

Commit

Permalink
Adjust Beats container user to be numeric.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Montgomery <[email protected]>
  • Loading branch information
naemono committed Oct 10, 2024
1 parent 648ec22 commit 4a7a39e
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 4a7a39e

Please sign in to comment.