From d037d95148b2acc88d4aebc60de9f7c32917a1e8 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 12 Oct 2023 09:50:51 +0200 Subject: [PATCH] warning that order matters --- .../packaging/templates/docker/Dockerfile.elastic-agent.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl index 676e1243031..3f7dff2401d 100644 --- a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl +++ b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl @@ -144,6 +144,7 @@ RUN chown {{ .user }} /app {{- end }} {{- end }} +# Keep this after any chown command, chown resets any applied capabilities RUN setcap cap_net_raw,cap_setuid+p {{ $beatHome }}/data/elastic-agent-{{ commit_short }}/components/heartbeat && \ {{- if .linux_capabilities }} # Since the beat is stored at the other end of a symlink we must follow the symlink first