Skip to content

Commit e46bc35

Browse files
authored
Fix wrong binary for setting capabilities (#5070)
Since we transitioned to `agentbeat` we now need to use `setcap` on a different binary.
1 parent 7476517 commit e46bc35

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: bug-fix
2+
summary: Use setcap on a correct agentbeat binary
3+
component: "elastic-agent"

dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ RUN mkdir /app && \
144144
{{- end }}
145145

146146
# Keep this after any chown command, chown resets any applied capabilities
147-
RUN setcap cap_net_raw,cap_setuid+p {{ $beatHome }}/data/elastic-agent-{{ commit_short }}/components/heartbeat && \
147+
RUN setcap cap_net_raw,cap_setuid+p {{ $beatHome }}/data/elastic-agent-{{ commit_short }}/components/agentbeat && \
148148
{{- if .linux_capabilities }}
149149
# Since the beat is stored at the other end of a symlink we must follow the symlink first
150150
# For security reasons setcap does not support symlinks. This is smart in the general case
@@ -240,4 +240,3 @@ RUN echo -e '#!/bin/sh\nexec /usr/local/bin/docker-entrypoint' > /app/apm.sh &&
240240
{{- else }}
241241
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-entrypoint"]
242242
{{- end }}
243-

0 commit comments

Comments
 (0)