-
-
Notifications
You must be signed in to change notification settings - Fork 6
Make uid/gid configurable & change group of files #849
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1b1947e
WIP
lfrancke 6e8b5c3
Fix install command
lfrancke d816f77
Rework image to get the commands in order and have everything owned b…
lfrancke 3f23ce9
Make precommit happy(er)
lfrancke 0b07019
Adjust Druid
lfrancke fba55d4
Adjust Hadoop
lfrancke 429cb68
Merge branch 'main' into feature/image-tools-revamp
lfrancke fc18df6
Update to image-tools 0.0.13
lfrancke 89578b0
Merge branch 'main' into feature/image-tools-revamp
lfrancke 5c0b829
Fix Druid & Hadoop
lfrancke 42476b2
Fix Hadoop
lfrancke 922f420
Adjust HBase
lfrancke 35abeb4
Adjust Hello-World
lfrancke 73e8253
Fix Hadoop
lfrancke 7c2703e
Fix HBase
lfrancke 682a945
WIP Fix Hive
lfrancke 7da3f59
Merge branch 'main' into feature/image-tools-revamp
lfrancke 04a89b2
Merge branch 'main' into feature/image-tools-revamp
lfrancke 3b31b28
Merge branch 'main' into feature/image-tools-revamp
lfrancke 025cb93
Merge branch 'main' into feature/image-tools-revamp
lfrancke f131525
Delete unused file
lfrancke b3b7ed2
Merge branch 'refs/heads/main' into feature/image-tools-revamp
lfrancke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,12 +8,12 @@ ARG JMX_EXPORTER | |
| ARG PROTOBUF | ||
| ARG TARGETARCH | ||
| ARG TARGETOS | ||
| ARG STACKABLE_USER_UID | ||
|
|
||
| USER ${STACKABLE_USER_UID} | ||
| WORKDIR /stackable | ||
|
|
||
| COPY hadoop/stackable/jmx /stackable/jmx | ||
| COPY hadoop/stackable/fuse_dfs_wrapper /stackable/fuse_dfs_wrapper | ||
| COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/jmx /stackable/jmx | ||
| COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/fuse_dfs_wrapper /stackable/fuse_dfs_wrapper | ||
|
|
||
| # The symlink from JMX Exporter 0.16.1 to the versionless link exists because old HDFS Operators (up until and including 23.7) used to hardcode | ||
| # the version of JMX Exporter like this: "-javaagent:/stackable/jmx/jmx_prometheus_javaagent-0.16.1.jar" | ||
|
|
@@ -54,7 +54,7 @@ RUN microdnf update && \ | |
|
|
||
| WORKDIR /stackable | ||
|
|
||
| COPY hadoop/stackable/patches /stackable/patches | ||
| COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/patches /stackable/patches | ||
|
|
||
| # Hadoop Pipes requires libtirpc to build, whose headers are not packaged in RedHat UBI, so skip building this module | ||
| # Build from source to enable FUSE module, and to apply custom patches. | ||
|
|
@@ -92,6 +92,7 @@ FROM stackable/image/java-devel AS hdfs-utils-builder | |
|
|
||
| ARG HDFS_UTILS | ||
| ARG PRODUCT | ||
| ARG STACKABLE_USER_UID | ||
|
|
||
| USER ${STACKABLE_USER_UID} | ||
| WORKDIR /stackable | ||
|
|
@@ -113,6 +114,7 @@ FROM stackable/image/java-base AS final | |
| ARG PRODUCT | ||
| ARG RELEASE | ||
| ARG HDFS_UTILS | ||
| ARG STACKABLE_USER_UID | ||
|
|
||
| LABEL name="Apache Hadoop" \ | ||
| maintainer="[email protected]" \ | ||
|
|
@@ -126,25 +128,26 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/hadoop-${PRODUCT} | |
| COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/ | ||
| COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/async-profiler /stackable/async-profiler/ | ||
| COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar | ||
| COPY hadoop/stackable/fuse_dfs_wrapper /stackable/hadoop/bin | ||
| COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/fuse_dfs_wrapper /stackable/ | ||
|
|
||
|
|
||
| # fuse is required for fusermount (called by fuse_dfs) | ||
| # fuse-libs is required for fuse_dfs (not included in fuse) | ||
| # openssl -> not sure | ||
| RUN <<EOF | ||
| microdnf update | ||
| # tar is required for `kubectl cp` which can be used to copy the log files | ||
| # or profiler flamegraph from the Pod | ||
| # It is already installed in the base image but leaving here for documentation purposes | ||
| microdnf install \ | ||
| fuse \ | ||
| fuse-libs \ | ||
| # tar is required for `kubectl cp` which can be used to copy the log files | ||
| # or profiler flamegraph from the Pod | ||
| # It is already installed in the base image but leaving here for documentation purposes | ||
| tar | ||
| microdnf clean all | ||
| rm -rf /var/cache/yum | ||
|
|
||
| ln -s /stackable/hadoop-${PRODUCT} /stackable/hadoop | ||
| mv /stackable/fuse_dfs_wrapper /stackable/hadoop/bin | ||
|
|
||
| # Remove unneeded binaries: | ||
| # - code sources | ||
|
|
@@ -173,7 +176,7 @@ EOF | |
|
|
||
| COPY hadoop/licenses /licenses | ||
|
|
||
| USER stackable | ||
| USER ${STACKABLE_USER_UID} | ||
|
|
||
| ENV HOME=/stackable | ||
| ENV LD_LIBRARY_PATH=/stackable/hadoop/lib/native:/usr/lib/jvm/jre/lib/server | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ FROM stackable/image/java-base | |
|
|
||
| ARG PRODUCT | ||
| ARG RELEASE | ||
| ARG STACKABLE_USER_UID | ||
|
|
||
| LABEL name="Hello World" \ | ||
| maintainer="[email protected]" \ | ||
|
|
@@ -13,13 +14,20 @@ LABEL name="Hello World" \ | |
| summary="The Stackable image for the Stackable Hello World Operator" \ | ||
| description="This image is deployed by the Stackable Hello World Operator." | ||
|
|
||
| RUN microdnf update && \ | ||
| microdnf clean all && \ | ||
| rm -rf /var/cache/yum | ||
| RUN <<EOF | ||
| microdnf update | ||
| microdnf clean all | ||
| rm -rf /var/cache/yum | ||
lfrancke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| USER stackable | ||
| WORKDIR /stackable | ||
| curl "https://repo.stackable.tech/repository/packages/hello-world/hello-world-${PRODUCT}.jar" -o /stackable/hello-world.jar | ||
|
|
||
| # All files and folders owned by root to support running as arbitrary users | ||
| # This is best practice as all container users will belong to the root group (0) | ||
| chown -R ${STACKABLE_USER_UID}:0 /stackable | ||
| chmod -R g=u /stackable | ||
| EOF | ||
|
|
||
| RUN curl "https://repo.stackable.tech/repository/packages/hello-world/hello-world-${PRODUCT}.jar" -o hello-world.jar | ||
| USER ${STACKABLE_USER_UID} | ||
| WORKDIR /stackable | ||
|
|
||
| CMD ["java", "-jar", "hello-world.jar"] | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.