diff --git a/distribution/docker/src/docker/dockerfiles/default/Dockerfile b/distribution/docker/src/docker/dockerfiles/default/Dockerfile index 47d4840e61698..0e22e56307cb9 100644 --- a/distribution/docker/src/docker/dockerfiles/default/Dockerfile +++ b/distribution/docker/src/docker/dockerfiles/default/Dockerfile @@ -29,23 +29,20 @@ RUN microdnf install -y findutils tar gzip # The tini GitHub page gives instructions for verifying the binary using # gpg, but the keyservers are slow to return the key and this can fail the # build. Instead, we check the binary against the published checksum. -RUN set -eux ; \\ - tini_bin="" ; \\ - arch="\$(rpm --query --queryformat='%{ARCH}' rpm)"; \ - case "\$(arch)" in \\ - aarch64) tini_bin='tini-arm64' ;; \\ - x86_64) tini_bin='tini-amd64' ;; \\ - *) echo >&2 ; echo >&2 "Unsupported architecture \$arch" ; echo >&2 ; exit 1 ;; \\ +RUN set -eux; \\ + arch="\$(rpm --query --queryformat='%{ARCH}' rpm)"; \\ + case "\$arch" in \\ + aarch64) tini_bin='tini-arm64'; tini_sum='07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81' ;; \\ + x86_64) tini_bin='tini-amd64'; tini_sum='93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c' ;; \\ + *) echo >&2 "Unsupported architecture \$arch"; exit 1 ;; \\ esac ; \\ - curl -f --retry 10 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin} ; \\ - curl -f --retry 10 -S -L -O https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin}.sha256sum ; \\ - sha256sum -c \${tini_bin}.sha256sum ; \\ - rm \${tini_bin}.sha256sum ; \\ - mv \${tini_bin} /bin/tini ; \\ + curl -f --retry 10 -S -L -o /tmp/tini https://github.com/krallin/tini/releases/download/v0.19.0/\${tini_bin}; \\ + echo "\${tini_sum} /tmp/tini" | sha256sum -c -; \\ + mv /tmp/tini /bin/tini; \\ chmod 0555 /bin/tini WORKDIR /usr/share/elasticsearch -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 +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 RUN tar -zxf /tmp/elasticsearch.tar.gz --strip-components=1 && \\ # Configure the distribution for Docker sed -i -e 's/ES_DISTRIBUTION_TYPE=tar/ES_DISTRIBUTION_TYPE=docker/' bin/elasticsearch-env && \\ @@ -111,12 +108,10 @@ ENV SHELL=/bin/bash COPY --chmod=0555 bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN chmod g=u /etc/passwd && \\ - chmod 0555 /usr/local/bin/docker-entrypoint.sh && \\ find / -xdev -perm -4000 -exec chmod ug-s {} + && \\ chmod 0775 /usr/share/elasticsearch && \\ chown elasticsearch bin config config/jvm.options.d data logs plugins - EXPOSE 9200 9300 LABEL org.label-schema.build-date="${build_date}" \\