Refactor Docker image to allow faster rebuilds#23
Merged
brianloss merged 4 commits intoapache:next-releasefrom Sep 19, 2022
Merged
Refactor Docker image to allow faster rebuilds#23brianloss merged 4 commits intoapache:next-releasefrom
brianloss merged 4 commits intoapache:next-releasefrom
Conversation
* Update the docker build setup to separate the Accumulo installation
from the Hadoop/Zookeeper installation. This allows for repeated
builds with just the Accumulo layer changing to be much faster.
- Move build arg declarations to just before they are used, since
changing a build arg will invalidate all layers after it in the
Dockerfile.
* Replace empty "_FILE" build args with a default of _NOT_SET and check
for that default when deciding whether or not to download the tarball
from Apache servers. A "COPY" command with an empty build arg ends up
copying the entire build context into the image, which is not what we
want.
dlmarion
approved these changes
Sep 19, 2022
keith-turner
approved these changes
Sep 19, 2022
Contributor
keith-turner
left a comment
There was a problem hiding this comment.
this looks good. I like how jdk-headless ends up being in the final image and jdk-devel is only used for building the intermediate image and discarded.
* Change glob patterns for extracted archive copy so that it does not depend on the "*_VERSION" variables. Now one can change the included file without having to update the corresponding VERSION variable. * Fix a potential issue where if the "_FILE" arg is specified but named a non-existent file, the download script would silently try to download whatever version was specific in the "_VERSION" variable. This could lead to an unintended version getting included in the final image. Instead, the download script now fails if a "_FILE" build arg is set, but the corresponding file does not exist.
Contributor
|
There is a line in the readme that can be changed now. Can omit the version in the following line from the readme. |
Member
Author
Good catch. Will change... |
keith-turner
approved these changes
Sep 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert the existing Docker image into a multi-stage image with
independent layers for the base, Hadoop, Zookeeper, and Accumulo tarball
download/extraction (and native library build in the Accumulo case).
By having each install come from a separate base image, we can modify
the file/version for any of the packages and reuse the build cached for
the others, which greatly improves build times for a developer who is
iterating on Accumulo, for example. Also, by using a separate builder
base, the larger JDK and make tools were installed to build the Accumulo
native libraries, but then those tools are not included in the final
image.