Skip to content

Commit

Permalink
Fix wrong user for installing Synthetics
Browse files Browse the repository at this point in the history
The current user must be used instead of `root`.
  • Loading branch information
rdner committed Sep 11, 2024
1 parent c75a7a4 commit f4030ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev-tools/packaging/templates/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ RUN echo \
{{ $beatHome }}/.cache \
| xargs -IDIR sh -c 'mkdir -m 0770 -p DIR && chown -R {{ .user }} DIR'

USER {{ .user }}
RUN (npm i -g --loglevel verbose --production --engine-strict @elastic/synthetics@stack_release || sh -c 'tail -n +1 ${NPM_CONFIG_PREFIX}/_logs/* && exit 1')
{{- end }}

Expand Down Expand Up @@ -204,7 +205,7 @@ RUN cd /usr/share/heartbeat/.node \

# Install synthetics as a regular user, installing npm deps as root odesn't work
RUN chown -R {{ .user }} $NODE_PATH

USER {{ .user }}
# If this fails dump the NPM logs
RUN npm i -g --loglevel verbose --production --engine-strict @elastic/synthetics@stack_release || sh -c 'tail -n +1 /root/.npm/_logs/* && exit 1'
RUN chmod ug+rwX -R $NODE_PATH
Expand Down

0 comments on commit f4030ef

Please sign in to comment.