Skip to content

Commit 2e9fe8a

Browse files
committed
Add support for ubi8-complete image
1 parent cb9d3a7 commit 2e9fe8a

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

dev-tools/packaging/packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ shared:
620620
extra_vars:
621621
image_name: '{{.BeatName}}-ubi8'
622622
from: 'docker.elastic.co/ubi8/ubi-minimal'
623+
variants: ["complete"]
623624

624625
- &docker_arm_ubi_spec
625626
extra_vars:

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ ENV ELASTIC_AGENT_IMAGE_VARIANT={{.Variant}}
4343
ENV BEAT_SETUID_AS={{ .user }}
4444

4545
{{- if contains .from "ubi-minimal" }}
46-
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)
46+
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)
47+
RUN microdnf install -y jq
4748
{{- else }}
4849
# Installing jq needs to be installed after epel-release and cannot be in the same yum install command.
4950
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; \
5859
(exit $exit_code)
5960
{{- end }}
6061

61-
{{- if (and (eq .Variant "complete") (not (contains .from "ubi-minimal"))) }}
62+
{{- if (eq .Variant "complete") }}
63+
{{- if (not (contains .from "ubi-minimal")) }}
6264
RUN for iter in {1..10}; do \
6365
yum -y install atk cups gtk gdk xrandr pango libXcomposite libXcursor libXdamage \
6466
libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 \
@@ -68,6 +70,16 @@ RUN for iter in {1..10}; do \
6870
exit_code=0 && break || exit_code=$? && echo "yum error: retry $iter in 10s" && sleep 10; \
6971
done; \
7072
(exit $exit_code)
73+
{{- else }}
74+
RUN for iter in {1..10}; do \
75+
microdnf -y install atk cups xrandr pango libXcomposite libXcursor libXdamage \
76+
libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 \
77+
alsa-lib atk gtk3 findutils tar xz && \
78+
microdnf clean all && \
79+
exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && sleep 10; \
80+
done; \
81+
(exit $exit_code)
82+
{{- end }}
7183
ENV NODE_PATH={{ $beatHome }}/.node
7284
RUN echo \
7385
$NODE_PATH \
@@ -156,7 +168,7 @@ RUN mkdir /app
156168
{{- else }}
157169
RUN groupadd --gid 1000 {{ .BeatName }}
158170
RUN useradd -M --uid 1000 --gid 1000 --groups 0 --home {{ $beatHome }} {{ .user }}
159-
{{- if (and (eq .Variant "complete") (not (contains .from "ubi-minimal"))) }}
171+
{{- if (eq .Variant "complete") }}
160172
RUN chown {{ .user }} $NODE_PATH
161173
{{- end }}
162174
{{- if contains .image_name "-cloud" }}
@@ -167,7 +179,7 @@ RUN chown {{ .user }} /app
167179
{{- end }}
168180
USER {{ .user }}
169181

170-
{{- if (and (eq .Variant "complete") (not (contains .from "ubi-minimal"))) }}
182+
{{- if (eq .Variant "complete") }}
171183
# Setup synthetics env vars
172184
ENV ELASTIC_SYNTHETICS_CAPABLE=true
173185
ENV SUITES_DIR={{ $beatHome }}/suites

0 commit comments

Comments
 (0)