Skip to content

Commit 7372a73

Browse files
kibanamachinejbudz
andauthored
[8.19] [build] Dockerfile feedback (elastic#217354) (elastic#218726)
# Backport This will backport the following commits from `main` to `8.19`: - [[build] Dockerfile feedback (elastic#217354)](elastic#217354) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jon","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-04-21T12:44:22Z","message":"[build] Dockerfile feedback (elastic#217354)\n\nAddresses feedback from\nhttps://github.com/docker-library/official-images/pull/18692.\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/6005","sha":"9b90fa5197884cefcf0ba808ce968703733a9225","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:version","v9.1.0","v8.19.0"],"title":"[build] Dockerfile feedback","number":217354,"url":"https://github.com/elastic/kibana/pull/217354","mergeCommit":{"message":"[build] Dockerfile feedback (elastic#217354)\n\nAddresses feedback from\nhttps://github.com/docker-library/official-images/pull/18692.\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/6005","sha":"9b90fa5197884cefcf0ba808ce968703733a9225"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217354","number":217354,"mergeCommit":{"message":"[build] Dockerfile feedback (elastic#217354)\n\nAddresses feedback from\nhttps://github.com/docker-library/official-images/pull/18692.\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/6005","sha":"9b90fa5197884cefcf0ba808ce968703733a9225"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jon <[email protected]>
1 parent e3f2f3a commit 7372a73

File tree

1 file changed

+12
-16
lines changed
  • src/dev/build/tasks/os_packages/docker_generator/templates/base

1 file changed

+12
-16
lines changed

src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ RUN apk --no-cache add curl
2323

2424
{{#usePublicArtifact}}
2525
RUN cd /tmp && \
26-
curl --retry 8 -s -L \
26+
{{#wolfi}}arch="$(apk --print-arch)" ; \ {{/wolfi}}{{#ubi}}arch="$(rpm --query --queryformat='%{ARCH}' rpm)"; \ {{/ubi}} && \
27+
curl -f --retry 8 -s -L \
2728
--output kibana.tar.gz \
28-
https://{{publicArtifactSubdomain}}.elastic.co/downloads/kibana/{{artifactPrefix}}-$(arch).tar.gz && \
29+
https://{{publicArtifactSubdomain}}.elastic.co/downloads/kibana/{{artifactPrefix}}-$arch.tar.gz && \
2930
cd -
3031
{{/usePublicArtifact}}
3132
{{^usePublicArtifact}}
@@ -47,18 +48,19 @@ RUN chmod -R g=u /usr/share/kibana
4748
# Add an init process, check the checksum to make sure it's a match
4849
RUN set -e ; \
4950
TINI_BIN="" ; \
50-
case "$(arch)" in \
51+
{{#wolfi}}arch="$(apk --print-arch)" ; \ {{/wolfi}}{{#ubi}}arch="$(rpm --query --queryformat='%{ARCH}' rpm)"; \ {{/ubi}}
52+
case "$arch" in \
5153
aarch64) \
5254
TINI_BIN='tini-arm64' ; \
5355
;; \
5456
x86_64) \
5557
TINI_BIN='tini-amd64' ; \
5658
;; \
57-
*) echo >&2 "Unsupported architecture $(arch)" ; exit 1 ;; \
59+
*) echo >&2 "Unsupported architecture $arch" ; exit 1 ;; \
5860
esac ; \
5961
TINI_VERSION='v0.19.0' ; \
60-
curl --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}" ; \
61-
curl --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}.sha256sum" ; \
62+
curl -f --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}" ; \
63+
curl -f --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}.sha256sum" ; \
6264
sha256sum -c "${TINI_BIN}.sha256sum" ; \
6365
rm "${TINI_BIN}.sha256sum" ; \
6466
mv "${TINI_BIN}" /bin/tini ; \
@@ -88,14 +90,9 @@ FROM {{{baseImageName}}}
8890
EXPOSE 5601
8991

9092
{{#ubi}}
91-
RUN for iter in {1..10}; do \
92-
microdnf update --setopt=tsflags=nodocs -y && \
93-
microdnf install --setopt=tsflags=nodocs -y \
93+
RUN microdnf install --setopt=tsflags=nodocs -y \
9494
fontconfig liberation-fonts-common freetype shadow-utils nss findutils && \
95-
microdnf clean all && exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && \
96-
sleep 10; \
97-
done; \
98-
(exit $exit_code)
95+
microdnf clean all
9996
{{/ubi}}
10097
{{#ubuntu}}
10198
RUN for iter in {1..10}; do \
@@ -131,7 +128,7 @@ RUN ln -s /usr/share/kibana /opt/kibana
131128

132129
{{! Please notify @elastic/kibana-security if you want to remove or change this environment variable. }}
133130
{{! Kibana applications may depend on the ELASTIC_CONTAINER value. Screenshotting uses this to conditionally disable the Chromium sandbox when launching Puppeteer. }}
134-
ENV ELASTIC_CONTAINER true
131+
ENV ELASTIC_CONTAINER=true
135132
ENV PATH=/usr/share/kibana/bin:$PATH
136133

137134
# Set some Kibana configuration defaults.
@@ -198,8 +195,7 @@ LABEL name="Kibana" \
198195
summary="Kibana" \
199196
description="Your window into the Elastic Stack."
200197

201-
RUN mkdir /licenses && \
202-
cp LICENSE.txt /licenses/LICENSE
198+
RUN mkdir /licenses && ln LICENSE.txt /licenses/LICENSE
203199
{{/ubi}}
204200

205201
ENTRYPOINT ["/bin/tini", "--"]

0 commit comments

Comments
 (0)