Skip to content

Commit 12f80fa

Browse files
authored
[Build] Address further dockerhub feedback on default Dockerfile (elastic#128686) (elastic#128944)
* [Build] Address further dockerhub feedback on default Dockerfile * Bring back license folder * Minor cleanup * polishing
1 parent 79eff38 commit 12f80fa

File tree

1 file changed

+10
-15
lines changed
  • distribution/docker/src/docker/dockerfiles/default

1 file changed

+10
-15
lines changed

distribution/docker/src/docker/dockerfiles/default/Dockerfile

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,20 @@ RUN microdnf install -y findutils tar gzip
2929
# The tini GitHub page gives instructions for verifying the binary using
3030
# gpg, but the keyservers are slow to return the key and this can fail the
3131
# build. Instead, we check the binary against the published checksum.
32-
RUN set -eux ; \\
33-
tini_bin="" ; \\
34-
arch="\$(rpm --query --queryformat='%{ARCH}' rpm)"; \
35-
case "\$(arch)" in \\
36-
aarch64) tini_bin='tini-arm64' ;; \\
37-
x86_64) tini_bin='tini-amd64' ;; \\
38-
*) echo >&2 ; echo >&2 "Unsupported architecture \$arch" ; echo >&2 ; exit 1 ;; \\
32+
RUN set -eux; \\
33+
arch="\$(rpm --query --queryformat='%{ARCH}' rpm)"; \\
34+
case "\$arch" in \\
35+
aarch64) tini_bin='tini-arm64'; tini_sum='07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81' ;; \\
36+
x86_64) tini_bin='tini-amd64'; tini_sum='93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c' ;; \\
37+
*) echo >&2 "Unsupported architecture \$arch"; exit 1 ;; \\
3938
esac ; \\
40-
curl -f --retry 10 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin} ; \\
41-
curl -f --retry 10 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin}.sha256sum ; \\
42-
sha256sum -c \${tini_bin}.sha256sum ; \\
43-
rm \${tini_bin}.sha256sum ; \\
44-
mv \${tini_bin} /bin/tini ; \\
39+
curl -f --retry 10 -S -L -o /tmp/tini https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin}; \\
40+
echo "\${tini_sum} /tmp/tini" | sha256sum -c -; \\
41+
mv /tmp/tini /bin/tini; \\
4542
chmod 0555 /bin/tini
4643
4744
WORKDIR /usr/share/elasticsearch
48-
RUN arch="\$(rpm --query --queryformat='%{ARCH}' rpm)" && curl -f --retry 10 -S -L --output /tmp/elasticsearch.tar.gz https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-${version}-linux-\$(arch).tar.gz
45+
RUN arch="\$(rpm --query --queryformat='%{ARCH}' rpm)" && curl -f --retry 10 -S -L --output /tmp/elasticsearch.tar.gz https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-${version}-linux-\$arch.tar.gz
4946
RUN tar -zxf /tmp/elasticsearch.tar.gz --strip-components=1 && \\
5047
# Configure the distribution for Docker
5148
sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' bin/elasticsearch-env && \\
@@ -111,12 +108,10 @@ ENV SHELL=/bin/bash
111108
COPY --chmod=0555 bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
112109

113110
RUN chmod g=u /etc/passwd && \\
114-
chmod 0555 /usr/local/bin/docker-entrypoint.sh && \\
115111
find / -xdev -perm -4000 -exec chmod ug-s {} + && \\
116112
chmod 0775 /usr/share/elasticsearch && \\
117113
chown elasticsearch bin config config/jvm.options.d data logs plugins
118114

119-
120115
EXPOSE 9200 9300
121116

122117
LABEL org.label-schema.build-date="${build_date}" \\

0 commit comments

Comments
 (0)