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

Fix wrong user for installing Synthetics #40747

Merged
merged 1 commit into from
Sep 11, 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
4 changes: 3 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,11 +205,12 @@ 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

USER root
# Install the deps as needed by the exact version of playwright elastic synthetics uses
# We don't use npx playwright install-deps because that could pull a newer version
# Install additional fonts as well
Expand Down
Loading