diff --git a/dev-tools/packaging/packages.yml b/dev-tools/packaging/packages.yml index c0dc436f034..21ab4c844ce 100644 --- a/dev-tools/packaging/packages.yml +++ b/dev-tools/packaging/packages.yml @@ -620,6 +620,7 @@ shared: extra_vars: image_name: '{{.BeatName}}-ubi8' from: 'docker.elastic.co/ubi8/ubi-minimal' + variants: ["complete"] - &docker_arm_ubi_spec extra_vars: diff --git a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl index 0044852b149..cf462815cb4 100644 --- a/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl +++ b/dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl @@ -43,7 +43,8 @@ ENV ELASTIC_AGENT_IMAGE_VARIANT={{.Variant}} ENV BEAT_SETUID_AS={{ .user }} {{- if contains .from "ubi-minimal" }} -RUN for iter in {1..10}; do microdnf update -y && microdnf install -y shadow-utils jq && microdnf clean all && exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && sleep 10; done; (exit $exit_code) +RUN for iter in {1..10}; do rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && microdnf update -y && microdnf install -y shadow-utils jq && microdnf clean all && exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && sleep 10; done; (exit $exit_code) +RUN microdnf install -y jq {{- else }} # Installing jq needs to be installed after epel-release and cannot be in the same yum install command. RUN case $(arch) in aarch64) YUM_FLAGS="-x bind-license";; esac; \ @@ -58,7 +59,8 @@ RUN case $(arch) in aarch64) YUM_FLAGS="-x bind-license";; esac; \ (exit $exit_code) {{- end }} -{{- if (and (eq .Variant "complete") (not (contains .from "ubi-minimal"))) }} +{{- if (eq .Variant "complete") }} +{{- if (not (contains .from "ubi-minimal")) }} RUN for iter in {1..10}; do \ yum -y install atk cups gtk gdk xrandr pango libXcomposite libXcursor libXdamage \ libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 \ @@ -68,6 +70,16 @@ RUN for iter in {1..10}; do \ exit_code=0 && break || exit_code=$? && echo "yum error: retry $iter in 10s" && sleep 10; \ done; \ (exit $exit_code) +{{- else }} +RUN for iter in {1..10}; do \ + microdnf -y install atk cups xrandr pango libXcomposite libXcursor libXdamage \ + libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 \ + alsa-lib atk gtk3 findutils tar xz && \ + microdnf clean all && \ + exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && sleep 10; \ + done; \ + (exit $exit_code) +{{- end }} ENV NODE_PATH={{ $beatHome }}/.node RUN echo \ $NODE_PATH \ @@ -156,7 +168,7 @@ RUN mkdir /app {{- else }} RUN groupadd --gid 1000 {{ .BeatName }} RUN useradd -M --uid 1000 --gid 1000 --groups 0 --home {{ $beatHome }} {{ .user }} -{{- if (and (eq .Variant "complete") (not (contains .from "ubi-minimal"))) }} +{{- if (eq .Variant "complete") }} RUN chown {{ .user }} $NODE_PATH {{- end }} {{- if contains .image_name "-cloud" }} @@ -167,7 +179,7 @@ RUN chown {{ .user }} /app {{- end }} USER {{ .user }} -{{- if (and (eq .Variant "complete") (not (contains .from "ubi-minimal"))) }} +{{- if (eq .Variant "complete") }} # Setup synthetics env vars ENV ELASTIC_SYNTHETICS_CAPABLE=true ENV SUITES_DIR={{ $beatHome }}/suites