-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Use official checksums to verify Tini #55491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
067fb59
9875a82
57fc364
73af316
8909ebc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
FROM ${base_image} AS builder | ||
|
||
RUN for iter in {1..10}; do yum update --setopt=tsflags=nodocs -y && \ | ||
yum install --setopt=tsflags=nodocs -y gzip shadow-utils tar && \ | ||
yum install --setopt=tsflags=nodocs -y epel-release && yum install --setopt=tsflags=nodocs -y dpkg wget gzip shadow-utils tar && \ | ||
james-crowley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
yum clean all && exit_code=0 && break || exit_code=\$? && echo "yum error: retry \$iter in 10s" && sleep 10; done; \ | ||
(exit \$exit_code) | ||
|
||
|
@@ -40,11 +40,13 @@ RUN chmod 0660 config/elasticsearch.yml config/log4j2.properties | |
# | ||
# 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 a checksum that we have | ||
# computed. | ||
ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini${tini_suffix} /tini | ||
COPY config/tini${tini_suffix}.sha512 /tini.sha512 | ||
RUN sha512sum -c /tini.sha512 && chmod +x /tini | ||
# build. Instead, we check the binary against a checksum that they provide. | ||
RUN wget --no-check-certificate --no-cookies --quiet https://github.com/krallin/tini/releases/download/v0.19.0/tini-\$(dpkg --print-architecture) \ | ||
james-crowley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
&& wget --no-check-certificate --no-cookies --quiet https://github.com/krallin/tini/releases/download/v0.19.0/tini-\$(dpkg --print-architecture).sha256sum \ | ||
&& echo "\$(cat tini-\$(dpkg --print-architecture).sha256sum)" | sha256sum -c \ | ||
james-crowley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
&& rm -f tini-\$(dpkg --print-architecture).sha256sum \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no need to remove the checksum, since this is just the builder image. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason I remove it was were still under the working dir of What would be easier is to move the whole Tini "block" of code up before you change the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my latest commit, I moved the Tini code "block" up in the Dockerfile before you change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like that we removed the checksum file even if it's currently unneeded, because it means if there's a later refactoring that would for example, accidentally revert executing this in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jasontedor @pugnascotia I am flexiable either way.
I think this is key. If there is no new layer were not adding to the build time or build size. Plus, like @jasontedor, its just the builder image. |
||
&& mv tini-\$(dpkg --print-architecture) /tini \ | ||
&& chmod +x /tini | ||
|
||
################################################################################ | ||
# Build stage 1 (the actual elasticsearch image): | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasontedor Question for you, since
centos
uses manifests for their Docker builds pulling from the specific arch is unneeded. Was there another reason to directly pull fromarm64v8/centos:7
? Or would pulling fromcentos:7
work? You can see the manifests/archs that Centos supports here, https://hub.docker.com/_/centos?tab=tags.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thinking here is that using an explicit base image makes it possible to cross-build the ARM image, for example using Docker for Mac. It's entirely possible that we'll revert to just specifying
centos:7
in the future however.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense! I went a head a made the
amd64
image explicit too in case you’re not on ax86
system.Using manifests for this would help simplify things but all depends on your CI/CD. How are you currently building and publishing your images? Does Elastic have access to
arm64
hardware that you will build thearm
docker images on? Or are you planning on usingqemu
andbinfmt_misc
to emulate the architectures so you can build all the images onx86
hardware?I am happy to lend a hand if you need when it comes to building multi-arch containers and building out manifests. Being at IBM, I do that quite a lot! 😄
Are you planning on producing manifests for your
arm64
andamd64
images? That would be really cool to see!!One quick note with using
qemu
andbinfmt_misc
is that there are some bugs you might run into. Images might seem like they built correctly, but when ran on the specific hardware you will run into errors. Hence why I encourage people to build on platform if they can. I am currently helping the Jenkins Docker team to build on platform for each of their images. AWS does offerarm64
resources, in case you guys were interested.